Skip to content

Commit

Permalink
Merge pull request #243 from hms-dbmi/PPM-766
Browse files Browse the repository at this point in the history
PPM-766 - Fixed Composition creation
  • Loading branch information
b32147 authored Jul 15, 2024
2 parents 920503e + e1c45ec commit 1d474c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
15 changes: 3 additions & 12 deletions app/fhirquestionnaire/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ def submit_consent(study, patient_email, form, pdf=None, dry=False):
text = '<div>{}</div>'.format(render_to_string('consent/{}/_consent.html'.format(study)))

# Generate composition
composition = PPMFHIR.Resources.composition(patient, timestamp, text, [consent, contract])

# Add the study reference
composition.setdefault("section", []).append({"entry": [{"reference": f"ResearchStudy/{PPM.Study.fhir_id(study)}"}]})
composition = PPMFHIR.Resources.composition(patient, timestamp, text, PPM.Study.get(study), [consent, contract])

# Add it to the resources
resources.append(composition)
Expand Down Expand Up @@ -213,10 +210,7 @@ def submit_asd_individual(patient_email, forms, dry=False):
text = '<div>{}</div>'.format(render_to_string('consent/asd/_individual_consent.html'))

# Generate composition
composition = PPMFHIR.Resources.composition(patient, timestamp, text, [consent, contract])

# Add the study reference
composition.setdefault("section", []).append({"entry": [{"reference": f"ResearchStudy/{PPM.Study.fhir_id(PPM.Study.ASD)}"}]})
composition = PPMFHIR.Resources.composition(patient, timestamp, text, PPM.Study.ASD, [consent, contract])

# Bundle it into a transaction
bundle = PPMFHIR.Resources.bundle([questionnaire_response, consent, contract, composition, quiz_questionnaire_response])
Expand Down Expand Up @@ -341,10 +335,7 @@ def submit_asd_guardian(patient_email, forms, dry=False):
text = '<div>{}</div>'.format(render_to_string('consent/asd/_guardian_consent.html'))

# Generate composition
composition = PPMFHIR.Resources.composition(patient, timestamp, text, [consent, signature_contract, explained_contract])

# Add the study reference
composition.setdefault("section", []).append({"entry": [{"reference": f"ResearchStudy/{PPM.Study.fhir_id(PPM.Study.ASD)}"}]})
composition = PPMFHIR.Resources.composition(patient, timestamp, text, PPM.Study.ASD, [consent, signature_contract, explained_contract])

# Map exception codes to linkId
ward_exception_codes = {
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ orderedmultidict==1.0.1 \
--hash=sha256:04070bbb5e87291cc9bfa51df413677faf2141c73c61d2a5f7b26bea3cd882ad \
--hash=sha256:43c839a17ee3cdd62234c47deca1a8508a3f2ca1d0678a3bf791c87cf84adbf3
# via furl
ppm-utils==2.0.4 \
--hash=sha256:8c20e7edf44cd107425a5f7d5281e63408013eac1e69e6f2ce307895c0752b53 \
--hash=sha256:92755026bd29224025a2c9ad04552a482420891aba86fe81ade3680463994b7f
ppm-utils==2.0.5 \
--hash=sha256:eefe497da10c690dffc6a85b88a60d4d9efc0f0c48ec720fa549c8ca82c726a5 \
--hash=sha256:f4d3a29c84c46047070144729b533d46294945f6762d23cfd5fc504c0d8ed1a7
# via -r requirements.in
proto-plus==1.24.0 \
--hash=sha256:30b72a5ecafe4406b0d339db35b56c4059064e69227b8c3bda7462397f966445 \
Expand Down

0 comments on commit 1d474c3

Please sign in to comment.