{
  "resourceType": "StructureDefinition",
  "url": "https://example.org/fhir/StructureDefinition/SirirajPatientObservation",
  "name": "SirirajPatientObservation",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "mustSupport": true
      },
      {
        "id": "Observation.extension",
        "path": "Observation.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Observation.extension:active-type",
        "path": "Observation.extension",
        "sliceName": "active-type",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://example.org/fhir/StructureDefinition/SirirajPatientObservationTypeExtension"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Observation.extension:active-type.value[x].coding.system",
        "path": "Observation.extension.value[x].coding.system",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier",
        "path": "Observation.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "short": "ข้อมูลอ้างอิงพื่อระบุตัวตน และใช้สำหรับอ้างอิงในการค้นหา",
        "definition": "ข้อมูลอ้างอิงพื่อระบุตัวตน และใช้สำหรับอ้างอิงในการค้นหา",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceNationalID",
        "path": "Observation.identifier",
        "sliceName": "sliceNationalID",
        "label": "หมายเลขบัตรประชาชน",
        "short": "หมายเลขบัตรประชาชน (National ID.)",
        "definition": "หมายเลขบัตรประชาชนสำหรับอ้างอิงพื่อระบุตัวตน และใช้สำหรับอ้างอิงในการค้นหา"
      },
      {
        "id": "Observation.identifier:sliceNationalID.system",
        "path": "Observation.identifier.system",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceNationalID.value",
        "path": "Observation.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceHospitalNo",
        "path": "Observation.identifier",
        "sliceName": "sliceHospitalNo",
        "label": "หมายเลขผู้ป่วย",
        "short": "หมายเลขผู้ป่วย (Hospital No.)",
        "definition": "หมายเลขที่โรงพยาบาลออกให้ผู้ป่วยสำหรับอ้างอิงพื่อระบุตัวตน และใช้สำหรับอ้างอิงในการค้นหา"
      },
      {
        "id": "Observation.identifier:sliceHospitalNo.system",
        "path": "Observation.identifier.system",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceHospitalNo.value",
        "path": "Observation.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceVisitNo",
        "path": "Observation.identifier",
        "sliceName": "sliceVisitNo",
        "label": "หมายเลขเข้ารับบริการ",
        "short": "หมายเลขเข้ารับบริการ (Visit No.)",
        "definition": "หมายเลขที่โรงพยาบาลออกให้ผู้ป่วยในการเข้ารับบริการสำหรับอ้างอิงพื่อระบุตัวตน และใช้สำหรับอ้างอิงในการค้นหา"
      },
      {
        "id": "Observation.identifier:sliceVisitNo.system",
        "path": "Observation.identifier.system",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceVisitNo.value",
        "path": "Observation.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceServiceNo",
        "path": "Observation.identifier",
        "sliceName": "sliceServiceNo",
        "label": "หมายเลขการสั่งตรวจ",
        "short": "หมายเลขการสั่งตรวจ (Service No.)",
        "definition": "หมายเลขที่โรงพยาบาลออกให้ผู้ป่วยในการสั่งวัดสัญญาณชีพสำหรับอ้างอิงพื่อระบุตัวตน และใช้สำหรับอ้างอิงในการค้นหา"
      },
      {
        "id": "Observation.identifier:sliceServiceNo.system",
        "path": "Observation.identifier.system",
        "mustSupport": true
      },
      {
        "id": "Observation.identifier:sliceServiceNo.value",
        "path": "Observation.identifier.value",
        "mustSupport": true
      },
      {
        "id": "Observation.status",
        "path": "Observation.status",
        "definition": "สถานะการวัดสัญญาณชีพ <br>\r\n   1. registered = การมีอยู่ของการสังเกตได้รับการจดทะเบียน แต่ยังไม่มีผลลัพธ์ใด ๆ <br>\r\n   2. preliminary = เป็นข้อสังเกตเบื้องต้น ข้อมูลอาจไม่สมบูรณ์หรือไม่ได้รับการยืนยัน <br>\r\n   3. final = การสังเกตเสร็จสมบูรณ์และไม่จําเป็นต้องดําเนินการเพิ่มเติม <br>\r\n   4. amended   ข้อมูลมีการแก้ไข หรือเพิ่มเติมหลังจากการออกผล<br>\r\n   5. cancelled  มีการแก้ไขข้อมูลที่ผิดพลาดหลังจากการออกผล<br>\r\n   6. entered-in-error  <br>\r\n   7. unknown  ไม่ทราบแหล่งที่มาของข้อมูล<br>",
        "mustSupport": true
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "label": "ประเภทของการสังเกตุการณ์",
        "short": "ประเภทของการสังเกตุการณ์ (Observation type)",
        "definition": "ประเภทของการสังเกตุการณ์ (Observation type)",
        "mustSupport": true
      },
      {
        "id": "Observation.category.coding.system",
        "path": "Observation.category.coding.system",
        "mustSupport": true
      },
      {
        "id": "Observation.category.coding.code",
        "path": "Observation.category.coding.code",
        "mustSupport": true
      },
      {
        "id": "Observation.category.coding.display",
        "path": "Observation.category.coding.display",
        "mustSupport": true
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Observation.code:sliceIoinc",
        "path": "Observation.code",
        "sliceName": "sliceIoinc",
        "short": "แหล่งอ้างอิงมาตรฐานสำหรับการระบุการตรวจวัด",
        "definition": "แหล่งอ้างอิงมาตรฐานสากลสำหรับการระบุการตรวจวัด การสังเกต และเอกสารด้านสุขภาพ"
      },
      {
        "id": "Observation.code:sliceIoinc.coding.system",
        "path": "Observation.code.coding.system",
        "mustSupport": true
      },
      {
        "id": "Observation.code:sliceIoinc.coding.code",
        "path": "Observation.code.coding.code",
        "mustSupport": true
      },
      {
        "id": "Observation.code:sliceSnomed",
        "path": "Observation.code",
        "sliceName": "sliceSnomed",
        "short": "แหล่งอ้างอิงระบบจัดการคำศัพท์ทางการแพทย์"
      },
      {
        "id": "Observation.code:sliceSnomed.coding.system",
        "path": "Observation.code.coding.system",
        "mustSupport": true
      },
      {
        "id": "Observation.code:sliceSnomed.coding.code",
        "path": "Observation.code.coding.code",
        "mustSupport": true
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "mustSupport": true
      },
      {
        "id": "Observation.subject.reference",
        "path": "Observation.subject.reference",
        "mustSupport": true
      },
      {
        "id": "Observation.subject.display",
        "path": "Observation.subject.display",
        "mustSupport": true
      },
      {
        "id": "Observation.encounter",
        "path": "Observation.encounter",
        "mustSupport": true
      },
      {
        "id": "Observation.encounter.reference",
        "path": "Observation.encounter.reference",
        "mustSupport": true
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Observation.performer:SlicePractitioner",
        "path": "Observation.performer",
        "sliceName": "SlicePractitioner",
        "label": "ผู้ปฏิบัติงาน",
        "short": "ผู้ปฏิบัติงาน (Practitioner)",
        "definition": "ผู้ปฏิบัติงาน ซึ่งอาจหมายถึง <br>\r\n  1. แพทย์<br>\r\n  2. พยาบาล<br>\r\n  3. หรืออื่น ๆ ที่รับผิดชอบ"
      },
      {
        "id": "Observation.performer:SlicePractitioner.reference",
        "path": "Observation.performer.reference",
        "mustSupport": true
      },
      {
        "id": "Observation.performer:SlicePractitioner.display",
        "path": "Observation.performer.display",
        "mustSupport": true
      },
      {
        "id": "Observation.performer:SliceLocation",
        "path": "Observation.performer",
        "sliceName": "SliceLocation",
        "label": "สถานที่ปฏิบัติงาน",
        "short": "สถานที่ปฏิบัติงาน (Clinic, Ward or Location of activity)",
        "definition": "สถานที่ปฏิบัติงาน ซึ่งอาจหมายถึง <br>\r\n  1. คลินิก (Clinic)<br>\r\n  2. หอผู้ป่วย (Ward)<br>  \r\n  3. หรืออื่น ๆ ที่รับผิดชอบ"
      },
      {
        "id": "Observation.performer:SliceLocation.reference",
        "path": "Observation.performer.reference",
        "mustSupport": true
      },
      {
        "id": "Observation.performer:SliceLocation.display",
        "path": "Observation.performer.display",
        "mustSupport": true
      },
      {
        "id": "Observation.derivedFrom",
        "path": "Observation.derivedFrom",
        "mustSupport": true
      },
      {
        "id": "Observation.derivedFrom.reference",
        "path": "Observation.derivedFrom.reference",
        "mustSupport": true
      },
      {
        "id": "Observation.derivedFrom.display",
        "path": "Observation.derivedFrom.display",
        "mustSupport": true
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "mustSupport": true
      },
      {
        "id": "Observation.component.code.coding.system",
        "path": "Observation.component.code.coding.system",
        "mustSupport": true
      },
      {
        "id": "Observation.component.code.coding.code",
        "path": "Observation.component.code.coding.code",
        "mustSupport": true
      },
      {
        "id": "Observation.component.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Observation.component.value[x].value",
        "path": "Observation.component.value[x].value",
        "mustSupport": true
      },
      {
        "id": "Observation.component.value[x].unit",
        "path": "Observation.component.value[x].unit",
        "mustSupport": true
      },
      {
        "id": "Observation.component.value[x].system",
        "path": "Observation.component.value[x].system",
        "mustSupport": true
      },
      {
        "id": "Observation.component.value[x].code",
        "path": "Observation.component.value[x].code",
        "mustSupport": true
      },
      {
        "id": "Observation.component.interpretation",
        "path": "Observation.component.interpretation",
        "mustSupport": true
      },
      {
        "id": "Observation.component.interpretation.coding.system",
        "path": "Observation.component.interpretation.coding.system",
        "mustSupport": true
      },
      {
        "id": "Observation.component.interpretation.coding.code",
        "path": "Observation.component.interpretation.coding.code",
        "mustSupport": true
      },
      {
        "id": "Observation.component.interpretation.coding.display",
        "path": "Observation.component.interpretation.coding.display",
        "mustSupport": true
      },
      {
        "id": "Observation.component.referenceRange",
        "path": "Observation.component.referenceRange",
        "contentReference": "http://hl7.org/fhir/StructureDefinition/Observation#Observation.referenceRange"
      }
    ]
  }
}