Add some upload samples

These are versions PH core
This commit is contained in:
Jörn Guy Süß 2025-08-04 11:17:33 +10:00
parent ea9ae2abf3
commit a6a8427eed
4 changed files with 456 additions and 0 deletions

View File

@ -0,0 +1,431 @@
{
"resourceType" : "Bundle",
"id" : "transaction-ex",
"type" : "transaction",
"entry" : [{
"fullUrl" : "urn:uuid:64eb2d39-8da6-4c1d-b4c7-a6d3e916cd5b",
"resource" : {
"resourceType" : "Patient",
"id" : "example-patient",
"meta" : {
"profile" : ["urn://example.com/ph-core/fhir/StructureDefinition/ph-core-patient"]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Patient_example-patient\"> </a>Juan Dela Cruz is a male patient born on 1 January 1980, residing in Manila, NCR, Philippines.</div>"
},
"extension" : [{
"extension" : [{
"url" : "code",
"valueCodeableConcept" : {
"coding" : [{
"system" : "urn:iso:std:iso:3166",
"code" : "PH",
"display" : "Philippines"
}]
}
},
{
"url" : "period",
"valuePeriod" : {
"start" : "2020-01-01",
"end" : "2023-01-01"
}
}],
"url" : "http://hl7.org/fhir/StructureDefinition/patient-nationality"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/patient-religion",
"valueCodeableConcept" : {
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/v3-ReligiousAffiliation",
"code" : "1007",
"display" : "Atheism"
}]
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/indigenous-people",
"valueBoolean" : true
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/indigenous-group",
"valueCodeableConcept" : {
"coding" : [{
"system" : "urn://example.com/ph-core/fhir/CodeSystem/indigenous-groups",
"code" : "Ilongots",
"display" : "Ilongots"
}]
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/race",
"valueCodeableConcept" : {
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/v3-Race",
"code" : "2036-2",
"display" : "Filipino"
}]
}
}],
"identifier" : [{
"system" : "http://philhealth.gov.ph/fhir/Identifier/philhealth-id",
"value" : "63-584789845-5"
}],
"active" : true,
"name" : [{
"family" : "Dela Cruz",
"given" : ["Juan Jane",
"Dela Fuente"]
}],
"gender" : "male",
"birthDate" : "1985-06-15",
"address" : [{
"extension" : [{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/city-municipality",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "1380200000",
"display" : "City of Las Piñas"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/city-municipality",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "1380100000",
"display" : "City of Caloocan"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/province",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "0402100000",
"display" : "Cavite"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/province",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "0403400000",
"display" : "Laguna"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/province",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "0405800000",
"display" : "Rizal"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/province",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "1704000000",
"display" : "Marinduque"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/province",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "0402100000",
"display" : "Cavite"
}
},
{
"url" : "urn://example.com/ph-core/fhir/StructureDefinition/province",
"valueCoding" : {
"system" : "urn://example.com/ph-core/fhir/CodeSystem/PSGC",
"code" : "1705100000",
"display" : "Occidental Mindoro"
}
}],
"line" : ["123 Mabini Street",
"Barangay Malinis"],
"city" : "Quezon City",
"district" : "NCR",
"postalCode" : "1100",
"country" : "PH"
}]
},
"request" : {
"method" : "POST",
"url" : "Patient"
}
},
{
"fullUrl" : "urn:uuid:60b7132e-7cfd-44bc-83c2-de140dc8aaae",
"resource" : {
"resourceType" : "Encounter",
"id" : "example-encounter",
"meta" : {
"profile" : ["urn://example.com/ph-core/fhir/StructureDefinition/ph-core-encounter"]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Encounter_example-encounter\"> </a>An ambulatory encounter for Juan Dela Cruz that has been completed.</div>"
},
"status" : "finished",
"class" : {
"system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code" : "AMB",
"display" : "ambulatory"
},
"subject" : {
"reference" : "urn:uuid:64eb2d39-8da6-4c1d-b4c7-a6d3e916cd5b"
}
},
"request" : {
"method" : "POST",
"url" : "Encounter"
}
},
{
"fullUrl" : "urn:uuid:1a391d1e-a068-479a-88e3-e3d52c3a6f64",
"resource" : {
"resourceType" : "Condition",
"id" : "example-condition",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Condition_example-condition\"> </a>Juan Dela Cruz has an active diagnosis of Type 2 Diabetes Mellitus.</div>"
},
"clinicalStatus" : {
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/condition-clinical",
"code" : "active",
"display" : "Active"
}]
},
"code" : {
"coding" : [{
"system" : "http://snomed.info/sct",
"code" : "44054006",
"display" : "Diabetes mellitus type 2"
}]
},
"subject" : {
"reference" : "urn:uuid:64eb2d39-8da6-4c1d-b4c7-a6d3e916cd5b"
},
"encounter" : {
"reference" : "urn:uuid:60b7132e-7cfd-44bc-83c2-de140dc8aaae"
}
},
"request" : {
"method" : "POST",
"url" : "Condition"
}
},
{
"fullUrl" : "urn:uuid:024dcb47-cc23-407a-839b-b4634e95abae",
"resource" : {
"resourceType" : "Medication",
"id" : "example-medication",
"meta" : {
"profile" : ["urn://example.com/ph-core/fhir/StructureDefinition/ph-core-medication"]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Medication_example-medication\"> </a>A medication resource has been created, but no specific details are provided.</div>"
}
},
"request" : {
"method" : "POST",
"url" : "Medication"
}
},
{
"fullUrl" : "urn:uuid:013f46df-f245-4a2f-beaf-9eb2c47fb1a3",
"resource" : {
"resourceType" : "Observation",
"id" : "blood-pressure",
"meta" : {
"profile" : ["urn://example.com/ph-core/fhir/StructureDefinition/ph-core-observation",
"http://hl7.org/fhir/StructureDefinition/vitalsigns",
"http://hl7.org/fhir/StructureDefinition/bp"]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Observation_blood-pressure\"> </a>On 17 September 2012, a blood pressure observation was recorded for Juan Dela Cruz. The systolic pressure was 107 mmHg (Normal), and the diastolic pressure was 60 mmHg (Below low normal). The measurement was taken from the right arm and performed by a practitioner.</div>"
},
"identifier" : [{
"system" : "urn:ietf:rfc:3986",
"value" : "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281"
}],
"basedOn" : [{
"identifier" : {
"system" : "https://acme.org/identifiers",
"value" : "1234"
}
}],
"status" : "final",
"category" : [{
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/observation-category",
"code" : "vital-signs",
"display" : "Vital Signs"
}]
}],
"code" : {
"coding" : [{
"system" : "http://loinc.org",
"code" : "85354-9",
"display" : "Blood pressure panel with all children optional"
}],
"text" : "Blood pressure systolic & diastolic"
},
"subject" : {
"reference" : "urn:uuid:64eb2d39-8da6-4c1d-b4c7-a6d3e916cd5b"
},
"effectiveDateTime" : "2012-09-17",
"performer" : [{
"reference" : "urn:uuid:a036fd4c-c950-497b-8905-0d2c5ec6f1d4"
}],
"interpretation" : [{
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"code" : "L",
"display" : "Low"
}],
"text" : "Below low normal"
}],
"bodySite" : {
"coding" : [{
"system" : "http://snomed.info/sct",
"code" : "85050009",
"display" : "Bone structure of humerus"
}]
},
"component" : [{
"code" : {
"coding" : [{
"system" : "http://loinc.org",
"code" : "8480-6",
"display" : "Systolic blood pressure"
}]
},
"valueQuantity" : {
"value" : 107,
"unit" : "mmHg",
"system" : "http://unitsofmeasure.org",
"code" : "mm[Hg]"
},
"interpretation" : [{
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"code" : "N",
"display" : "Normal"
}],
"text" : "Normal"
}]
},
{
"code" : {
"coding" : [{
"system" : "http://loinc.org",
"code" : "8462-4",
"display" : "Diastolic blood pressure"
}]
},
"valueQuantity" : {
"value" : 60,
"unit" : "mmHg",
"system" : "http://unitsofmeasure.org",
"code" : "mm[Hg]"
},
"interpretation" : [{
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation",
"code" : "L",
"display" : "Low"
}],
"text" : "Below low normal"
}]
}]
},
"request" : {
"method" : "POST",
"url" : "Observation"
}
},
{
"fullUrl" : "urn:uuid:b43c67e7-d9c4-48bb-a1b4-55769eeb9066",
"resource" : {
"resourceType" : "AllergyIntolerance",
"id" : "example-allergy",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"AllergyIntolerance_example-allergy\"> </a>Juan Dela Cruz has a high criticality, active allergy to Benethamine penicillin.</div>"
},
"clinicalStatus" : {
"coding" : [{
"system" : "http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical",
"code" : "active",
"display" : "Active"
}]
},
"criticality" : "high",
"code" : {
"coding" : [{
"system" : "http://snomed.info/sct",
"code" : "294494002",
"display" : "Benethamine penicillin allergy"
}]
},
"patient" : {
"reference" : "urn:uuid:64eb2d39-8da6-4c1d-b4c7-a6d3e916cd5b"
}
},
"request" : {
"method" : "POST",
"url" : "AllergyIntolerance"
}
},
{
"fullUrl" : "urn:uuid:a036fd4c-c950-497b-8905-0d2c5ec6f1d4",
"resource" : {
"resourceType" : "Practitioner",
"id" : "example-practitioner",
"meta" : {
"profile" : ["urn://example.com/ph-core/fhir/StructureDefinition/ph-core-practitioner"]
},
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><a name=\"Practitioner_example-practitioner\"> </a>Dr. Maria Clara Santos is a female practitioner born on May 15, 1985. She resides at 1234 Mabini Street, Manila, NCR, 1000, Philippines. She can be contacted via mobile at +63-912-345-6789 or by email at maria.santos@example.ph.</div>"
},
"name" : [{
"family" : "Santos",
"given" : ["Maria",
"Clara"]
}],
"telecom" : [{
"system" : "phone",
"value" : "+63-912-345-6789",
"use" : "mobile"
},
{
"system" : "email",
"value" : "maria.santos@example.ph",
"use" : "work"
}],
"address" : [{
"use" : "home",
"line" : ["1234 Mabini Street"],
"city" : "Manila",
"state" : "NCR",
"postalCode" : "1000",
"country" : "PH"
}],
"gender" : "female",
"birthDate" : "1985-05-15"
},
"request" : {
"method" : "POST",
"url" : "Practitioner"
}
}]
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,25 @@
2025-07-31 12:34:21,943 - services - DEBUG - Received validate-sample request
2025-07-31 12:34:21,944 - services - DEBUG - Request params: package_name=example.fhir.ph.core.r4, version=0.1.0, sample_data_length=713
2025-07-31 12:34:21,944 - services - DEBUG - Using FHIR_PACKAGES_DIR from current_app config: /app/instance/fhir_packages
2025-07-31 12:34:21,944 - services - DEBUG - Checking package file: /app/instance/fhir_packages/example.fhir.ph.core.r4-0.1.0.tgz
2025-07-31 12:34:21,944 - services - DEBUG - Validating AllergyIntolerance against example.fhir.ph.core.r4#0.1.0
2025-07-31 12:34:21,944 - services - DEBUG - Using FHIR_PACKAGES_DIR from current_app config: /app/instance/fhir_packages
2025-07-31 12:34:21,945 - services - DEBUG - Searching for SD matching 'AllergyIntolerance' with profile 'None' in example.fhir.ph.core.r4-0.1.0.tgz
2025-07-31 12:34:21,956 - services - INFO - SD matching identifier 'AllergyIntolerance' or profile 'None' not found within archive example.fhir.ph.core.r4-0.1.0.tgz
2025-07-31 12:34:21,956 - services - INFO - Validation result for AllergyIntolerance against example.fhir.ph.core.r4#0.1.0: valid=False, errors=1, warnings=0
2025-07-31 12:34:21,957 - werkzeug - INFO - 10.0.0.102 - - [31/Jul/2025 12:34:21] "POST /api/validate-sample HTTP/1.1" 200 -
2025-07-31 12:34:24,510 - werkzeug - INFO - 10.0.2.245 - - [31/Jul/2025 12:34:24] "GET / HTTP/1.1" 200 -
2025-07-31 12:34:27,378 - werkzeug - INFO - 10.0.2.245 - - [31/Jul/2025 12:34:27] "GET / HTTP/1.1" 200 -
2025-07-31 12:34:34,510 - werkzeug - INFO - 10.0.2.245 - - [31/Jul/2025 12:34:34] "GET / HTTP/1.1" 200 -
2025-07-31 12:34:36,799 - __main__ - DEBUG - Scanning packages directory: /app/instance/fhir_packages
2025-07-31 12:34:36,800 - __main__ - DEBUG - Found 8 .tgz files: ['PHCDI.r4-0.1.0.tgz', 'hl7.fhir.uv.ips-1.1.0.tgz', 'hl7.fhir.r4.core-4.0.1.tgz', 'fhir.dicom-2022.4.20221006.tgz', 'hl7.terminology.r4-5.0.0.tgz', 'example.fhir.ph.core.r4-0.1.0.tgz', 'hl7.terminology.r4-6.4.0.tgz', 'hl7.fhir.uv.extensions.r4-5.2.0.tgz']
2025-07-31 12:34:36,813 - __main__ - DEBUG - Added package: PHCDI.r4#0.1.0
2025-07-31 12:34:36,837 - __main__ - DEBUG - Added package: hl7.fhir.uv.ips#1.1.0
2025-07-31 12:34:37,378 - werkzeug - INFO - 10.0.2.245 - - [31/Jul/2025 12:34:37] "GET / HTTP/1.1" 200 -
2025-07-31 12:34:37,514 - __main__ - DEBUG - Added package: hl7.fhir.r4.core#4.0.1
2025-07-31 12:34:37,622 - __main__ - DEBUG - Added package: fhir.dicom#2022.4.20221006
2025-07-31 12:34:38,008 - __main__ - DEBUG - Added package: hl7.terminology.r4#5.0.0
2025-07-31 12:34:38,015 - __main__ - DEBUG - Added package: example.fhir.ph.core.r4#0.1.0
2025-07-31 12:34:38,413 - __main__ - DEBUG - Added package: hl7.terminology.r4#6.4.0
2025-07-31 12:34:38,524 - __main__ - DEBUG - Added package: hl7.fhir.uv.extensions.r4#5.2.0
2025-07-31 12:34:38,525 - __main__ - DEBUG - Set package choices: [('', 'None'), ('PHCDI.r4#0.1.0', 'PHCDI.r4#0.1.0'), ('example.fhir.ph.core.r4#0.1.0', 'example.fhir.ph.core.r4#0.1.0'), ('fhir.dicom#2022.4.20221006', 'fhir.dicom#2022.4.20221006'), ('hl7.fhir.r4.core#4.0.1', 'hl7.fhir.r4.core#4.0.1'), ('hl7.fhir.uv.extensions.r4#5.2.0', 'hl7.fhir.uv.extensions.r4#5.2.0'), ('hl7.fhir.uv.ips#1.1.0', 'hl7.fhir.uv.ips#1.1.0'), ('hl7.terminology.r4#5.0.0', 'hl7.terminology.r4#5.0.0'), ('hl7.terminology.r4#6.4.0', 'hl7.terminology.r4#6.4.0')]