PH eReferral Implementation Guide
0.3.0-draft - draft
Philippines
PH eReferral Implementation Guide - Local Development build (v0.3.0-draft) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions
An AI coding assistant (GitHub Copilot) was used throughout this project to accelerate the conversion pipeline. This page documents the key decisions made by the AI, all of which were reviewed and confirmed by the IG author. For the broader methodology, see the Approach page.
The AI parsed scenario.xml and identified the personas (Charity, Abraham, Jane), the two business processes, and the clinical actions described in the narrative. From this it proposed the initial list of FHIR resource types needed (Patient, Practitioner, Organization, Encounter, Observation, Condition, ServiceRequest, Task, MedicationAdministration, RelatedPerson).
Since the data dictionary is an Excel workbook that tooling cannot read directly, the AI created a Python extraction script (extract-data-dictionary.py) to dump all sheets to CSV. It then analysed the 46 REF-* elements, their FHIR Profile and FHIR Element (R4) columns, and mapped each to a concrete resource instance.
Key reasoning steps:
Practitioner.name and PractitionerRole because the DD specifies PractitionerRole.practitioner → Practitioner.name — so two resources are needed per practitioner.birthDate.MedicationAdministration (rather than Procedure) because the scenario specifically describes dispensing IFA tablets.ServiceRequest is appropriate now, with DiagnosticReport deferred.Task.businessStatus (not Task.status) per the DD's own recommendation to separate human-meaningful state from the technical state machine.The AI selected LOINC codes for observations and SNOMED CT codes for conditions based on the codes specified in the DD's Value Set column where available, falling back to widely-used international codes where the DD had placeholders:
| Observation | Code | System |
|---|---|---|
| Chief complaint | 10154-3 | LOINC |
| Blood pressure panel | 85354-9 | LOINC |
| Heart rate | 8867-4 | LOINC |
| Respiratory rate | 9279-1 | LOINC |
| SpO₂ | 59408-5 | LOINC |
| Temperature | 8310-5 | LOINC |
| Weight | 29463-7 | LOINC |
Realistic Filipino-context values were generated for the example data:
The AI created the full script pipeline (generate-json-from-dd.py → validate-all.sh → convert-to-fsh.sh → update-dd-coverage.py) so that changes to the data dictionary or scenario can be propagated through to FSH with a single re-run. For details on each pipeline step, see the Technical Pipeline page.