@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sct: <http://snomed.info/id/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<https://fhir.apps.health/MedicationRequest/polaris-medicationrequest-detailed-example> a fhir:MedicationRequest ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "polaris-medicationrequest-detailed-example"] ; # 
  fhir:meta [
     fhir:source [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-pipeline-v2.3.0"^^xsd:anyURI ] ;
     fhir:profile ( [
       fhir:v "https://fhir.apps.health/StructureDefinition/polaris-core-medicationrequest"^^xsd:anyURI ;
       fhir:link <https://fhir.apps.health/StructureDefinition/polaris-core-medicationrequest>
     ] )
  ] ; # 
  fhir:text [
     fhir:status [ fhir:v "generated" ] ;
     fhir:div "<div xmlns=\"http://www.w3.org/1999/xhtml\">Prescribed ferrous sulfate 325 mg oral tablet for Avery Linwood on April 8, 2025. Take 1 tablet by mouth daily. Course duration: 90 days (until 2025-07-07). 2 repeats allowed.</div>"^^rdf:XMLLiteral
  ] ; # 
  fhir:contained ( [
     a fhir:Medication ;
     fhir:id [ fhir:v "med-ferrous-sulfate" ] ;
     fhir:meta [
       fhir:source [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-pipeline-v2.3.0"^^xsd:anyURI ] ;
       fhir:profile ( [
         fhir:v "https://fhir.apps.health/StructureDefinition/polaris-containedmedication-core"^^xsd:anyURI ;
         fhir:link <https://fhir.apps.health/StructureDefinition/polaris-containedmedication-core>
       ] )
     ] ;
     fhir:extension ( [
       fhir:extension ( [
         fhir:url [ fhir:v "strengthText"^^xsd:anyURI ] ;
         fhir:value [
           a fhir:string ;
           fhir:v "325mg"
         ]
       ] [
         fhir:extension ( [
           fhir:url [ fhir:v "numerator"^^xsd:anyURI ] ;
           fhir:value [
             a fhir:Quantity ;
             fhir:value [ fhir:v "325"^^xsd:decimal ] ;
             fhir:unit [ fhir:v "mg" ] ;
             fhir:system [ fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ] ;
             fhir:code [ fhir:v "mg" ]
           ]
         ] [
           fhir:url [ fhir:v "denominator"^^xsd:anyURI ] ;
           fhir:value [
             a fhir:Quantity ;
             fhir:value [ fhir:v "1"^^xsd:decimal ] ;
             fhir:unit [ fhir:v "tablet" ] ;
             fhir:system [ fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ] ;
             fhir:code [ fhir:v "1" ]
           ]
         ] ) ;
         fhir:url [ fhir:v "strengthQuantity"^^xsd:anyURI ]
       ] ) ;
       fhir:url [ fhir:v "https://fhir.apps.health/StructureDefinition/polaris-medication-strength"^^xsd:anyURI ]
     ] ) ;
     fhir:code [
       fhir:coding ( [
         fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-medication-raw-code"^^xsd:anyURI ] ;
         fhir:code [ fhir:v "FE325" ] ;
         fhir:display [ fhir:v "Ferrous sulfate 325mg" ]
       ] ) ;
       fhir:text [ fhir:v "Ferrous sulfate 325mg" ]
     ] ;
     fhir:form [
       fhir:text [ fhir:v "Oral Tablet" ]
     ]
  ] ) ; # 
  fhir:identifier ( [
     fhir:use [ fhir:v "official" ] ;
     fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-medicationrequest-identifier"^^xsd:anyURI ] ;
     fhir:value [ fhir:v "RX-avery-20250408-detailed" ]
  ] [
     fhir:use [ fhir:v "secondary" ] ;
     fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-medicationrequest-raw-code"^^xsd:anyURI ] ;
     fhir:value [ fhir:v "EMR-RX-2025-04-08-001" ]
  ] ) ; # 
  fhir:status [ fhir:v "active"] ; # 
  fhir:statusReason [
     fhir:text [ fhir:v "New prescription for iron deficiency anemia" ]
  ] ; # 
  fhir:intent [ fhir:v "order"] ; # 
  fhir:medication [
     a fhir:Reference ;
     fhir:reference [ fhir:v "#med-ferrous-sulfate" ]
  ] ; # 
  fhir:subject [
     fhir:identifier [
       fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-patient-identifier"^^xsd:anyURI ] ;
       fhir:value [ fhir:v "1234567890" ]
     ]
  ] ; # 
  fhir:encounter [
     fhir:identifier [
       fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-encounter-identifier"^^xsd:anyURI ] ;
       fhir:value [ fhir:v "enc-avery-20250408-01" ]
     ]
  ] ; # 
  fhir:authoredOn [ fhir:v "2025-04-08"^^xsd:date] ; # 
  fhir:requester [
     fhir:identifier [
       fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-practitionerrole-identifier"^^xsd:anyURI ] ;
       fhir:value [ fhir:v "NAVARRO-ROLE-001" ]
     ]
  ] ; # 
  fhir:dosageInstruction ( [
     fhir:text [ fhir:v "Take one tablet by mouth daily." ] ;
     fhir:timing [
       fhir:repeat [
         fhir:bounds [
           a fhir:Period ;
           fhir:start [ fhir:v "2025-04-08"^^xsd:date ] ;
           fhir:end [ fhir:v "2025-07-07"^^xsd:date ]
         ]
       ]
     ] ;
     fhir:route [
       fhir:coding ( [
         a sct:26643006 ;
         fhir:system [ fhir:v "http://snomed.info/sct"^^xsd:anyURI ] ;
         fhir:code [ fhir:v "26643006" ] ;
         fhir:display [ fhir:v "Oral route" ]
       ] [
         fhir:system [ fhir:v "https://fhir.apps.health/NamingSystem/cedarbrook-clinic-medicationrequest-route-raw-code"^^xsd:anyURI ] ;
         fhir:code [ fhir:v "PO" ] ;
         fhir:display [ fhir:v "By mouth" ]
       ] ) ;
       fhir:text [ fhir:v "Oral route" ]
     ] ;
     fhir:doseAndRate ( [
       fhir:dose [
         a fhir:Quantity ;
         fhir:value [ fhir:v "1"^^xsd:decimal ] ;
         fhir:unit [ fhir:v "tablet" ] ;
         fhir:code [ fhir:v "1" ]
       ]
     ] )
  ] ) ; # 
  fhir:dispenseRequest [
     fhir:validityPeriod [
       fhir:start [ fhir:v "2025-04-08"^^xsd:date ] ;
       fhir:end [ fhir:v "2026-04-08"^^xsd:date ]
     ] ;
     fhir:numberOfRepeatsAllowed [ fhir:v "2"^^xsd:nonNegativeInteger ] ;
     fhir:quantity [
       fhir:value [ fhir:v "90"^^xsd:decimal ] ;
       fhir:unit [ fhir:v "tablets" ]
     ] ;
     fhir:expectedSupplyDuration [
       fhir:value [ fhir:v "90"^^xsd:decimal ] ;
       fhir:unit [ fhir:v "days" ] ;
       fhir:system [ fhir:v "http://unitsofmeasure.org"^^xsd:anyURI ] ;
       fhir:code [ fhir:v "d" ]
     ]
  ] . # 

# -------------------------------------------------------------------------------------

