@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 sct: <http://snomed.info/id/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

<http://fhir.hl7.org.vn/core/MedicationRequest/ExampleMedicationRequestOutpatientUppercasePrescriptionCode> a fhir:MedicationRequest ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:Resource.id [ fhir:value "ExampleMedicationRequestOutpatientUppercasePrescriptionCode"] ;
  fhir:Resource.meta [
     fhir:Meta.profile [
       fhir:value "http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-outpatient-prescription" ;
       fhir:index -1 ;
       fhir:link <http://fhir.hl7.org.vn/core/StructureDefinition/vn-core-outpatient-prescription>
     ]
  ] ;
  fhir:Resource.language [ fhir:value "vi"] ;
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ] ;
     fhir:Narrative.div "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: MedicationRequest ExampleMedicationRequestOutpatientUppercasePrescriptionCode</b></p><a name=\"ExampleMedicationRequestOutpatientUppercasePrescriptionCode\"> </a><a name=\"hcExampleMedicationRequestOutpatientUppercasePrescriptionCode\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\"/><p style=\"margin-bottom: 0px\">Profile: <a href=\"StructureDefinition-vn-core-outpatient-prescription.html\">Đơn thuốc ngoại trú VN Core — VN Core Outpatient Prescription Profile</a></p></div><p><b>status</b>: Active</p><p><b>intent</b>: Order</p><p><b>category</b>: <span title=\"Codes:{http://terminology.hl7.org/CodeSystem/medicationrequest-category outpatient}\">Outpatient</span></p><p><b>medication</b>: <span title=\"Codes:{http://www.whocc.no/atc J01CA04}\">Amoxicillin 500mg viên nang</span></p><p><b>subject</b>: <a href=\"Patient-ExamplePatientNguyenVanAn.html\">Nguyễn Văn An</a></p><p><b>encounter</b>: <a href=\"Encounter-ExampleEncounterOutpatient.html\">Encounter: identifier = Mã lượt khám chữa bệnh: VNMaLuotKCB#LK-2026-03-19-NGT-0207; status = finished; class = ambulatory (ActCode#AMB); period = 2026-03-19 08:30:00+0700 --&gt; 2026-03-19 11:00:00+0700; reasonCode = </a></p><p><b>authoredOn</b>: 2026-03-19 09:30:00+0700</p><p><b>requester</b>: <a href=\"Practitioner-ExamplePractitionerBSCKII.html\">BS CKII Nguyễn Thị Lan</a></p><p><b>reasonCode</b>: <span title=\"Codes:{http://fhir.hl7.org.vn/core/CodeSystem/vn-icd10-cs J18.9}\">Viêm phổi, không xác định</span></p><p><b>groupIdentifier</b>: <a href=\"NamingSystem-vn-prescription-code-ns.html\" title=\"Hệ thống định danh Mã đơn thuốc điện tử — 14 ký tự, ghép từ mã cơ sở KCB (05) + mã đơn (07) + dấu gạch + ký tự loại đơn. Cơ sở bán lẻ thuốc bán theo mã đơn và báo cáo về donthuocquocgia.vn.#xA;#xA;**Ai sinh mã.** Bộ Y tế là cơ quan quản trị cấu trúc mã và Hệ thống đơn thuốc quốc gia, nhưng mã cụ thể do phần mềm nguồn của cơ sở KCB (HIS) tự sinh theo cấu trúc rồi gửi lên: QĐ 808/QĐ-BYT đặt `ma_don_thuoc` trong FormData của request `/api/v1/gui-don-thuoc`, còn TT 26/2025/TT-BYT Phụ lục I chỉ nói mã 'được tạo ra tự động theo cấu trúc quy định' mà không nêu chủ thể. Không mô tả cổng quốc gia như bên cấp phát từng mã.#xA;#xA;**Ký tự loại đơn.** TT 26/2025/TT-BYT: `N` đơn thuốc gây nghiện, `H` đơn thuốc hướng thần/tiền chất, `C` đơn thuốc khác. TT 55/2025/TT-BYT dùng `T` cho đơn thuốc thang. QĐ 808/QĐ-BYT (contract cổng, ban hành trước) dùng bộ `C/N/H/Y` với `Y` cho đơn y học cổ truyền — giá trị legacy ở tầng transport, không dùng cho dữ liệu canonical.#xA;Căn cứ:#xA;- **TT 26/2025/TT-BYT** — kê đơn thuốc hoá dược, sinh phẩm ngoại trú; Điều 12 (liên thông đơn thuốc quốc gia, lĩnh thuốc trong 05 ngày kể từ ngày kê), Phụ lục I (cấu trúc mã đơn thuốc điện tử 14 ký tự); bãi bỏ TT 27/2021/TT-BYT từ 01/07/2025#xA;- **QĐ 808/QĐ-BYT (01/4/2022)** — hướng dẫn kết nối Hệ thống đơn thuốc quốc gia; cấu trúc mã đơn 14 ký tự#xA;- **QĐ 425/QĐ-BYT (05/02/2025)** — Quy chế quản lý, vận hành, sử dụng Hệ thống thông tin Quốc gia về quản lý kê đơn thuốc và bán thuốc theo đơn.\">VNPrescriptionCode</a>/79001000045A-C</p><p><b>insurance</b>: <a href=\"Coverage-ExampleCoverageBHYTNew.html\">Coverage: extension = Người lao động trong doanh nghiệp nhà nước,-&gt;Bệnh viện Chợ Rẫy; identifier = http://fhir.hl7.org.vn/core/sid/bhyt#VNBHYT#0791234567; status = active; type = Medical; relationship = Self; period = 2025-08-01 --&gt; 2026-07-31</a></p><p><b>note</b>: </p><blockquote><div><p>Đã đối chiếu tiền sử tại thời điểm kê đơn: không ghi nhận dị ứng Penicillin hoặc thuốc nhóm beta-lactam. Tái khám sau 7 ngày nếu không đỡ.</p>\n</div></blockquote><blockquote><p><b>dosageInstruction</b></p><p><b>sequence</b>: 1</p><p><b>text</b>: Uống 1 viên 500mg, 3 lần/ngày, sau ăn</p><p><b>timing</b>: 3 per 1 day</p><p><b>route</b>: <span title=\"Codes:{http://snomed.info/sct 26643006}\">Uống</span></p><h3>DoseAndRates</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Dose[x]</b></td></tr><tr><td style=\"display: none\">*</td><td>500 mg<span style=\"background: LightGoldenRodYellow\"> (Details: UCUM  codemg = 'mg')</span></td></tr></table></blockquote><blockquote><p><b>dispenseRequest</b></p><p><b>quantity</b>: 21 viên<span style=\"background: LightGoldenRodYellow\"> (Details: UCUM  code{tablet} = '{tablet}')</span></p><h3>ExpectedSupplyDurations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Value</b></td><td><b>Unit</b></td><td><b>System</b></td><td><b>Code</b></td></tr><tr><td style=\"display: none\">*</td><td>7</td><td>ngày</td><td><a href=\"http://hl7.org/fhir/uv/xver-r5.r4/0.1.0/CodeSystem-v3-ucum.html\">http://unitsofmeasure.org</a></td><td>d</td></tr></table></blockquote></div>"
  ] ;
  fhir:MedicationRequest.status [ fhir:value "active"] ;
  fhir:MedicationRequest.intent [ fhir:value "order"] ;
  fhir:MedicationRequest.category [
     fhir:index -1 ;
     fhir:CodeableConcept.coding [
       fhir:index -1 ;
       fhir:Coding.system [ fhir:value "http://terminology.hl7.org/CodeSystem/medicationrequest-category" ] ;
       fhir:Coding.code [ fhir:value "outpatient" ] ;
       fhir:Coding.display [ fhir:value "Outpatient" ]
     ]
  ] ;
  fhir:MedicationRequest.medicationCodeableConcept [
     fhir:CodeableConcept.coding [
       fhir:index -1 ;
       fhir:Coding.system [ fhir:value "http://www.whocc.no/atc" ] ;
       fhir:Coding.code [ fhir:value "J01CA04" ] ;
       fhir:Coding.display [ fhir:value "Amoxicillin" ]
     ] ;
     fhir:CodeableConcept.text [ fhir:value "Amoxicillin 500mg viên nang" ]
  ] ;
  fhir:MedicationRequest.subject [
     fhir:link <http://fhir.hl7.org.vn/core/Patient/ExamplePatientNguyenVanAn> ;
     fhir:Reference.reference [ fhir:value "Patient/ExamplePatientNguyenVanAn" ] ;
     fhir:Reference.display [ fhir:value "Nguyễn Văn An" ]
  ] ;
  fhir:MedicationRequest.encounter [
     fhir:link <http://fhir.hl7.org.vn/core/Encounter/ExampleEncounterOutpatient> ;
     fhir:Reference.reference [ fhir:value "Encounter/ExampleEncounterOutpatient" ]
  ] ;
  fhir:MedicationRequest.authoredOn [ fhir:value "2026-03-19T09:30:00+07:00"^^xsd:dateTime] ;
  fhir:MedicationRequest.requester [
     fhir:link <http://fhir.hl7.org.vn/core/Practitioner/ExamplePractitionerBSCKII> ;
     fhir:Reference.reference [ fhir:value "Practitioner/ExamplePractitionerBSCKII" ] ;
     fhir:Reference.display [ fhir:value "BS CKII Nguyễn Thị Lan" ]
  ] ;
  fhir:MedicationRequest.reasonCode [
     fhir:index -1 ;
     fhir:CodeableConcept.coding [
       fhir:index -1 ;
       fhir:Coding.system [ fhir:value "http://fhir.hl7.org.vn/core/CodeSystem/vn-icd10-cs" ] ;
       fhir:Coding.code [ fhir:value "J18.9" ] ;
       fhir:Coding.display [ fhir:value "Pneumonia, unspecified" ]
     ] ;
     fhir:CodeableConcept.text [ fhir:value "Viêm phổi, không xác định" ]
  ] ;
  fhir:MedicationRequest.groupIdentifier [
     fhir:Identifier.system [ fhir:value "http://fhir.hl7.org.vn/core/sid/don-thuoc-quoc-gia" ] ;
     fhir:Identifier.value [ fhir:value "79001000045A-C" ]
  ] ;
  fhir:MedicationRequest.insurance [
     fhir:index -1 ;
     fhir:link <http://fhir.hl7.org.vn/core/Coverage/ExampleCoverageBHYTNew> ;
     fhir:Reference.reference [ fhir:value "Coverage/ExampleCoverageBHYTNew" ]
  ] ;
  fhir:MedicationRequest.note [
     fhir:index -1 ;
     fhir:Annotation.text [ fhir:value "Đã đối chiếu tiền sử tại thời điểm kê đơn: không ghi nhận dị ứng Penicillin hoặc thuốc nhóm beta-lactam. Tái khám sau 7 ngày nếu không đỡ." ]
  ] ;
  fhir:MedicationRequest.dosageInstruction [
     fhir:index -1 ;
     fhir:Dosage.sequence [ fhir:value "1"^^xsd:integer ] ;
     fhir:Dosage.text [ fhir:value "Uống 1 viên 500mg, 3 lần/ngày, sau ăn" ] ;
     fhir:Dosage.timing [
       fhir:Timing.repeat [
         fhir:Timing.repeat.frequency [ fhir:value "3"^^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 -1 ;
         a sct:26643006 ;
         fhir:Coding.system [ fhir:value "http://snomed.info/sct" ] ;
         fhir:Coding.code [ fhir:value "26643006" ] ;
         fhir:Coding.display [ fhir:value "Oral route" ]
       ] ;
       fhir:CodeableConcept.text [ fhir:value "Uống" ]
     ] ;
     fhir:Dosage.doseAndRate [
       fhir:index -1 ;
       fhir:Dosage.doseAndRate.doseQuantity [
         fhir:Quantity.value [ fhir:value "500"^^xsd:decimal ] ;
         fhir:Quantity.unit [ fhir:value "mg" ] ;
         fhir:Quantity.system [ fhir:value "http://unitsofmeasure.org" ] ;
         fhir:Quantity.code [ fhir:value "mg" ]
       ]
     ]
  ] ;
  fhir:MedicationRequest.dispenseRequest [
     fhir:MedicationRequest.dispenseRequest.quantity [
       fhir:Quantity.value [ fhir:value "21"^^xsd:decimal ] ;
       fhir:Quantity.unit [ fhir:value "viên" ] ;
       fhir:Quantity.system [ fhir:value "http://unitsofmeasure.org" ] ;
       fhir:Quantity.code [ fhir:value "{tablet}" ]
     ] ;
     fhir:MedicationRequest.dispenseRequest.expectedSupplyDuration [
       fhir:Quantity.value [ fhir:value "7"^^xsd:decimal ] ;
       fhir:Quantity.unit [ fhir:value "ngày" ] ;
       fhir:Quantity.system [ fhir:value "http://unitsofmeasure.org" ] ;
       fhir:Quantity.code [ fhir:value "d" ]
     ]
  ] .

# - ontology header ------------------------------------------------------------

<http://fhir.hl7.org.vn/core/MedicationRequest/ExampleMedicationRequestOutpatientUppercasePrescriptionCode.ttl> a owl:Ontology ;
  owl:imports fhir:fhir.ttl .

# -------------------------------------------------------------------------------------

