-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed apis for new schema and added seeds
- Loading branch information
1 parent
983b447
commit 789a285
Showing
36 changed files
with
583 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,4 @@ | |
|
||
# Ignore master key for decrypting credentials and more. | ||
/config/master.key | ||
.idea | ||
.idea/ |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module ConsultationHelper | ||
class << self | ||
|
||
def add_data_to_consultation(new_prescriptions, new_invoices, new_claims, consultation_id) | ||
consultation = Consultation.find_by_id(consultation_id) | ||
invoices = consultation.invoices.to_a | ||
prescriptions = consultation.prescriptions.to_a | ||
new_invoices.each do |ninv| | ||
invoices << Invoice.create(amount: ninv[:amount], consultation: consultation) | ||
end | ||
new_prescriptions.each do |npr| | ||
prescriptions << Prescription.create(medicines: npr[:medicines], lab_tests: npr[:lab_tests], consultation: consultation) | ||
end | ||
claims = consultation.claims.to_a | ||
if new_claims | ||
new_claims.each do |nc| | ||
claims << nc | ||
end | ||
end | ||
consultation.update(invoices: invoices, prescriptions: prescriptions, claims: claims) | ||
return consultation | ||
end | ||
|
||
def create_or_update_consultation(health_report) # update todo | ||
Consultation.create(health_report: health_report) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.