@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<https://fhir.dha.go.ke/erx/MedicationDispense/example-medicationdispense-amina-azithromycin> a fhir:MedicationDispense ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "example-medicationdispense-amina-azithromycin"] ;
  fhir:Resource.meta [
     fhir:Meta.profile [
       fhir:value "https://fhir.dha.go.ke/erx/StructureDefinition/ke-medication-dispense" ;
       fhir:index 0 ;
       fhir:link <https://fhir.dha.go.ke/erx/StructureDefinition/ke-medication-dispense>
     ], [
       fhir:value "https://fhir.dha.go.ke/fhir/StructureDefinition/ke-medication-dispense" ;
       fhir:index 1 ;
       fhir:link <https://fhir.dha.go.ke/fhir/StructureDefinition/ke-medication-dispense>
     ]
  ] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Dispense DISP-2025-OPD-00456</b></p><p>First-fill dispense of Azithromycin 500 mg oral tablet — 3 tablets dispensed at KNH Outpatient Pharmacy against prescription RX-2025-OPD-00789 for Amina Hassan. Dispensed: 15 June 2025. 3-day supply.</p></div>"
  ] ;
  fhir:MedicationDispense.identifier [
     fhir:index 0 ;
     fhir:Identifier.system [ fhir:value "https://ilm-hie.dha.go.ke/fhir/NamingSystem/dispense-identifier" ] ;
     fhir:Identifier.value [ fhir:value "DISP-2025-OPD-00456" ]
  ] ;
  fhir:MedicationDispense.status [ fhir:value "completed"] ;
  fhir:MedicationDispense.medicationCodeableConcept [
     fhir:CodeableConcept.coding [
       fhir:index 0 ;
       fhir:Coding.system [ fhir:value "https://fhir.dha.go.ke/fhir/CodeSystem/generic-products-cs" ] ;
       fhir:Coding.code [ fhir:value "GE10015" ] ;
       fhir:Coding.display [ fhir:value "Azithromycin 500 mg Oral Tablet" ]
     ] ;
     fhir:CodeableConcept.text [ fhir:value "Azithromycin 500 mg Oral Tablet" ]
  ] ;
  fhir:MedicationDispense.subject [
     fhir:link <https://fhir.dha.go.ke/erx/Patient/example-patient-amina> ;
     fhir:Reference.reference [ fhir:value "Patient/example-patient-amina" ]
  ] ;
  fhir:MedicationDispense.context [
     fhir:link <https://fhir.dha.go.ke/erx/Encounter/example-encounter-amina-outpatient> ;
     fhir:Reference.reference [ fhir:value "Encounter/example-encounter-amina-outpatient" ]
  ] ;
  fhir:MedicationDispense.performer [
     fhir:index 0 ;
     fhir:MedicationDispense.performer.actor [
       fhir:link <https://fhir.dha.go.ke/erx/Organization/example-organization-knh> ;
       fhir:Reference.reference [ fhir:value "Organization/example-organization-knh" ]
     ]
  ] ;
  fhir:MedicationDispense.location [
     fhir:link <https://fhir.dha.go.ke/erx/Location/example-location-knh-pharmacy> ;
     fhir:Reference.reference [ fhir:value "Location/example-location-knh-pharmacy" ]
  ] ;
  fhir:MedicationDispense.authorizingPrescription [
     fhir:index 0 ;
     fhir:link <https://fhir.dha.go.ke/erx/MedicationRequest/example-medicationrequest-amina-azithromycin> ;
     fhir:Reference.reference [ fhir:value "MedicationRequest/example-medicationrequest-amina-azithromycin" ]
  ] ;
  fhir:MedicationDispense.type [
     fhir:CodeableConcept.coding [
       fhir:index 0 ;
       fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/v3-ActCode" ] ;
       fhir:Coding.code [ fhir:value "FF" ] ;
       fhir:Coding.display [ fhir:value "First Fill" ]
     ]
  ] ;
  fhir:MedicationDispense.quantity [
     fhir:Quantity.value [ fhir:value "3"^^xsd:decimal ] ;
     fhir:Quantity.unit [ fhir:value "tablet" ] ;
     fhir:Quantity.system [ fhir:value "http://unitsofmeasure.org" ] ;
     fhir:Quantity.code [ fhir:value "1" ]
  ] ;
  fhir:MedicationDispense.daysSupply [
     fhir:Quantity.value [ fhir:value "3"^^xsd:decimal ] ;
     fhir:Quantity.unit [ fhir:value "day" ] ;
     fhir:Quantity.system [ fhir:value "http://unitsofmeasure.org" ] ;
     fhir:Quantity.code [ fhir:value "d" ]
  ] ;
  fhir:MedicationDispense.whenPrepared [ fhir:value "2025-06-15T10:15:00+03:00"^^xsd:dateTime] ;
  fhir:MedicationDispense.whenHandedOver [ fhir:value "2025-06-15T10:30:00+03:00"^^xsd:dateTime] ;
  fhir:MedicationDispense.dosageInstruction [
     fhir:index 0 ;
     fhir:Dosage.text [ fhir:value "Take 1 tablet (500 mg) by mouth once daily for 3 days" ] ;
     fhir:Dosage.timing [
       fhir:Timing.repeat [
         fhir:Timing.repeat.frequency [ fhir:value "1"^^xsd:positiveInteger ] ;
         fhir:Timing.repeat.period [ fhir:value "1"^^xsd:decimal ] ;
         fhir:Timing.repeat.periodUnit [ fhir:value "d" ]
       ]
     ] ;
     fhir:Dosage.route [
       fhir:CodeableConcept.coding [
         fhir:index 0 ;
         fhir:Coding.system [ fhir:value "https://fhir.dha.go.ke/fhir/CodeSystem/route-of-administration-cs" ] ;
         fhir:Coding.code [ fhir:value "RT10025" ] ;
         fhir:Coding.display [ fhir:value "Oral" ]
       ]
     ]
  ] ;
  fhir:MedicationDispense.substitution [
     fhir:MedicationDispense.substitution.wasSubstituted [ fhir:value "false"^^xsd:boolean ]
  ] .

# - ontology header ------------------------------------------------------------

<https://fhir.dha.go.ke/erx/MedicationDispense/example-medicationdispense-amina-azithromycin.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl .

# -------------------------------------------------------------------------------------

