Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -177,57 +177,7 @@ def create_assessment(patient_id: str, code: str, value: str) -> DiagnosticRepor
|
|
177 |
report.effectiveDateTime = FHIRDate("2023-02-21")
|
178 |
|
179 |
return report
|
180 |
-
|
181 |
-
#def create_rule() -> Library:
|
182 |
-
# """
|
183 |
-
# Creates and returns a FHIR Library resource representing a rule.
|
184 |
-
# """
|
185 |
-
# rule = Library()
|
186 |
-
# rule.status = "draft"
|
187 |
-
# rule.type = CodeableConcept()
|
188 |
-
# rule.type.coding = [Coding()]
|
189 |
-
# rule.type.coding[0].system = "http://terminology.hl7.org/CodeSystem/library-type"
|
190 |
-
# rule.type.coding[0].code = "logic-library"
|
191 |
-
# rule.type.coding[0].display = "Logic Library"
|
192 |
-
# rule.content = [Attachment()]
|
193 |
-
# rule.content[0].contentType = "text/cql"
|
194 |
-
# rule.content[0].data = "some cql code here"
|
195 |
-
# rule.relatedArtifact = [RelatedArtifact()]
|
196 |
-
# rule.relatedArtifact[0].type = "depends-on"
|
197 |
-
# rule.relatedArtifact[0].resource = {"reference": "Library/example-library"}
|
198 |
-
|
199 |
-
# return rule
|
200 |
-
|
201 |
-
def create_referral_request(patient_id: str, reason: str, specialty: str, provider_name: str) -> ReferralRequest:
|
202 |
-
"""
|
203 |
-
Creates and returns a FHIR ReferralRequest resource with the given patient ID, reason, specialty, and provider name.
|
204 |
-
"""
|
205 |
-
referral = ReferralRequest()
|
206 |
-
referral.status = "active"
|
207 |
-
referral.subject = {"reference": f"Patient/{patient_id}"}
|
208 |
-
referral.reasonCode = [CodeableConcept()]
|
209 |
-
referral.reasonCode[0].coding = [Coding()]
|
210 |
-
referral.reasonCode[0].coding[0].system = "http://snomed.info/sct"
|
211 |
-
referral.reasonCode[0].coding[0].code = "123456"
|
212 |
-
referral.reasonCode[0].coding[0].display = reason
|
213 |
-
referral.specialty = CodeableConcept()
|
214 |
-
referral.specialty.coding = [Coding()]
|
215 |
-
referral.specialty.coding[0].system = "http://snomed.info/sct"
|
216 |
-
referral.specialty.coding[0].code = "123456"
|
217 |
-
referral.specialty.coding[0].display = specialty
|
218 |
-
referral.requester = {"reference": f"Practitioner/{provider_name}"}
|
219 |
-
referral.serviceRequested = [CodeableConcept()]
|
220 |
-
referral.serviceRequested[0].coding = [Coding()]
|
221 |
-
referral.serviceRequested[0].coding[0].system = "http://snomed.info/sct"
|
222 |
-
referral.serviceRequested[0].coding[0].code = "123456"
|
223 |
-
referral.serviceRequested[0].coding[0].display = "Example Service"
|
224 |
-
referral.priority = CodeableConcept()
|
225 |
-
referral.priority.coding = [Coding()]
|
226 |
-
referral.priority.coding[0].system = "http://terminology.hl7.org/CodeSystem/request-priority"
|
227 |
-
referral.priority.coding[0].code = "routine"
|
228 |
-
referral.priority.coding[0].display = "Routine"
|
229 |
-
|
230 |
-
return referral
|
231 |
|
232 |
def create_provider(name: str, organization_name: str) -> Tuple[Practitioner, PractitionerRole, Organization]:
|
233 |
"""
|
|
|
177 |
report.effectiveDateTime = FHIRDate("2023-02-21")
|
178 |
|
179 |
return report
|
180 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
def create_provider(name: str, organization_name: str) -> Tuple[Practitioner, PractitionerRole, Organization]:
|
183 |
"""
|