Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Purpose

API paragraph not found

Specification

...

idAPI_Specification

...

Link

...

https://ehealthmisapi1.docs.apiary.io/#reference/private.-reimbursement/private-medication-request/private.-get-medication-request-by-id

...

Посилання на Apiary або Swagger

...

Resource

...

Table of Contents

Purpose

WS returns data of MR to NHS Admin

Specification

...

request/{{id}}

Посилання на ресурс, наприклад: /api/persons/create

Scope

medication_request_

...

request:

...

read

Scope для доступу

Components

ePrescription

Зазначається перелік бізнес компонентів, які використовують цей метод, наприклад: ePrescription

Microservices

API paragraph not found

Перелік мікросервісів, які використовує метод API, наприклад: Auth, ABAC

Protocol type

REST

Тип протоколу, який використовується запитом, наприклад: SOAP | REST

Request type

GET

Тип запиту API, наприклад: GET, POST, PATCH…

Sync/Async

Sync

Метод є синхронним чи асинхронним?

Public/Private/Internal

Private

...

 

Logic

...

  1. Verify the validity of access token

  2. Check user scopes in order to perform this action (scope = 'medication_request_request:read')

  3. Search Requests for Medication request requests by id in WS url: 

    Code Block
    SELECT * FROM medication_request_requests 
        WHERE id=$.id 
            AND legal_entity_id = $.context.legal_entity_id
    
    

Logic WS for medication request requests based on care plan

  1. Get party_id  from $.context.user_id

  2. Get list from $.prm.employees for this party_id

  3. Get care_plan_id from $.medication_request_requests.data_based_on_care_plan_id

  4. Check $.approvals for user's employees (granted_to) on care_plan_id (granted_resources) and $.medication_request_requests.person_id (granted_by)

  5. Search Medication request requests by filters: data_based_on_care_plan_id, person_id.

    Code Block
    SELECT * FROM medication_request_requests MRR
    WHERE MRR.id = $.id 
        AND MRR.data_based_on_care_plan_id = $.id
        AND MRR.person_id = $.id
        AND MRR.is_active = TRUE
    

Input parameters

Input parameter

Values

Type

Description

Example

id

 

String

Medication

Request

identifier OR request_number

id.

Required

48416485-cc98-46c4-8bba-e321de9e1ecd

...

API paragraph not found

Authorize

Request to process the request using a token in the headers

Headers

...

Content-Type:application/json

Authorization:Bearer c2778f3064753ea70de870a53795f5c9

Request data validation

API paragraph not found

Processing

API paragraph not found

...

Validate request

Validate FK

  1. Validate id - medication_request_request_id exists

    • Return 422 in case validation fails (422 EView)

Response structure

See on Apiary

Example:

Expand
titleResponse example
Code Block
{
  "meta": {
    "code": 200,
    "url": "https://example.com/resource",
    "type": "object",
    "request_id": "6617aeec-15e2-4d6f-b9bd-53559c358f97#17810req-adasdoijasdojsda"
  },
  "data": {
    "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
    "status": "ACTIVENEW",
    "request_number": "0000-243P-1X53-EH38",
    "created_at": "2017-08-17",
    "started_at": "2017-08-17",
    "ended_at": "2017-09-16",
    "dispense_valid_from": "2017-08-17",
    "dispense_valid_to": "2017-09-16",
    "legal_entity": {
      "id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
      "name": "Клініка Ноунейм",
      "short_name": "Ноунейм",
      "public_name": "Клініка Ноунейм",
      "type": "MSP",
      "edrpou": "5432345432",
      "status": "ACTIVE"
    },
    "division": {
      "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "legal_entity_id": "c8aadb87-ecb9-41ca-9ad4-ffdfe1dd89c9",
      "name": "Бориспільське відділення Клініки Ноунейм",
      "addresses": [
        {
          "type": "RESIDENCE",
          "country": "UA",
          "area": "Житомирська",
          "region": "Бердичівський",
          "settlement": "Київ",
          "settlement_type": "CITY",
          "settlement_id": "b075f148",
          "street_type": "STREET",
          "street": "вул. Ніжинська",
          "building": "15",
          "apartment": "23",
          "zip": "02090"
        }
      ],
      "phones": [
        {
          "type": "MOBILE",
          "number": "+380503410870"
        }
      ],
      "email": "email@example.com",
      "working_hours": {
        "mon": [
          [
            "08.00",
            "12.00"
          ],
          [
            "14.00",
            "18.00"
          ]
        ],
        "tue": [
          [
            "08.00",
            "12.00"
          ]
        ],
        "wedtue": [
          [
            "08.00",
            "12.00"
          ]
        ],
        "thuwed": [
          [
            "08.00",
            "12.00"
          ]
        ],
        "frithu": [
          [
            "08.00",
            "12.00"
          ]
        ]
 ,
    },       "typefri": "CLINIC",[
      "external_id": "3213213",   [
   "location": {         "latitude": 30.1233,
        "longitude": 50.32423
      }08.00",
      "dls_id": "2872985",       "dls_verified": true12.00"
     },     "employee":]
{       "id": "d290f1ee-6c54-4b01-90e6-d701748f0851", ]
      "position": "P6"},
      "partytype": {"CLINIC",
        "external_id": "b075f148-7f93-4fc2-b2ec-2d81b19a9b7b3213213",
 
      "no_tax_idlocation": true,{
        "first_namelatitude": "Петро"30.1233,
        "last_namelongitude": "Іванов",
   50.32423
     "second_name": "Миколайович",
  },
      "emaildls_id": "email@example.com2872985",
        "phonesdls_verified": [true
    },
    "employee": {
      "id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
      "typeposition": "MOBILEP6",
      "party": {
        "numberid": "+380503410870"
      b075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
   }     "no_tax_id": true,
  ]       }"first_name": "Петро",
    },    "last_name": "personІванов":,
 {       "idsecond_name": "01352B970879A80E19B60C15C8E488DA26CABC3B9F7FA71684904A99DBD5ACE4Миколайович",
        "short_nameemail": "Петро І. І.email@example.com",
        "agephones": 35[
    },     "medication_info": {
      "medication_id      "type": "4a63b858-c138-4921-9341-ae9e384bcbd6MOBILE",
            "medication_namenumber": "Аміодарон+380503410870"
200мг таблетки",       "form": "PILL", }
     "dosage": {  ]
      "numerator_unit": "MG",}
    },
    "numerator_valueperson": 200,
 {
      "denumerator_unitid": "PILLb075f148-7f93-4fc2-b2ec-2d81b19a9b7b",
        "denumeratorshort_valuename": 1"Петро       }І. І.",
      "ingredientsage": [35
    },
   { "medication_info": {
        "medication_id": "1349a6934a63b858-4db1c138-4a3f4921-9ac69341-8c2f9e541982ae9e384bcbd6",
   
      "medication_name": "ІнсулінАміодарон деглюдек",
          "name_original": "Insulin degludec",
   200мг таблетки",
      "sctidform": "52574003PILL",
          "dosage": {
  
         "numerator_unit": "MG",
 
          "numerator_value": 200,
    200,
        "denumerator_unit": "PILL",
   
        "denumerator_value": 1
  
       },
          "is_primary"ingredients": true[
        }{
      ],    "id":   "medication_qty": 10.34"1349a693-4db1-4a3f-9ac6-8c2f9e541982",
     },     "medical_programname": {"Інсулін деглюдек",
     "id": "c7d52544-0bd4-4129-97b0-2d72633e0490",       "name_original": "ДоступніInsulin лікиdegludec",
          "medical_program_settingssctid": "52574003",
{          "care_plan_requireddosage": true,{
            "employee_types_to_create_medication_requestnumerator_unit": ["MG",
            "SPECIALIST"numerator_value": 200,
            "DOCTORdenumerator_unit"
    : "PILL",
   ],         "skip_mnn_in_treatment_perioddenumerator_value": true,1
        "skip_employee_validation": true,   },
          "specialityis_types_allowedprimary": [true
        }
 "ENDOCRINOLOGY",     ],
      "PEDIATRICmedication_NEUROLOGYqty": 10.34
    },
   ],
  "medical_program": {
      "conditions_icd10_am_allowedid": ["c7d52544-0bd4-4129-97b0-2d72633e0490",
      "name":    "A00.0"Доступні ліки",
   
      "A00.1"medical_program_settings": {
        ]"care_plan_required": true,
        "conditions_icpc2_allowedemployee_types_to_create_medication_request": [
          "A01SPECIALIST",
          "A02DOCTOR"
        ],
        "providing_conditions_allowed": [
          "INPATIENT",
 skip_mnn_in_treatment_period": true,
        "OUTPATIENTskip_employee_validation"
        ]: true,
        "medicationspeciality_request_max_period_day": 90,types_allowed": [
          "skip_medication_request_employee_declaration_verify": true,ENDOCRINOLOGY",
          "skip_medication_request_legal_entity_declaration_verify": truePEDIATRIC_NEUROLOGY"
        ],
        "multiconditions_medicationicd10_dispenseam_allowed": true,[
          "skip_medication_dispense_sign": true,A00.0",
          "medication_request_notification_disabled": trueA00.1"
        ],
        "skipconditions_contracticpc2_provision_verifyallowed": true,[
          "medication_dispense_period_day": 90,A01",
          "medical_program_change_on_dispense_allowed": trueA02"
        ],
        "patientproviding_categoriesconditions_allowed": [
          "insulin_1INPATIENT",
          "insulin_2OUTPATIENT"
        ],
        "license_types_allowedmedication_request_max_period_day": [90,
          "PHARMACY",
 "skip_medication_request_employee_declaration_verify": true,
        "PHARMACY_DRUGS"
skip_medication_request_legal_entity_declaration_verify": true,
       ]
  "multi_medication_dispense_allowed": true,
    },       "funding_source"skip_medication_dispense_sign": "NHS"true,
        "mrmedication_request_blanknotification_typedisabled": "F-1"true,
    },     "intent": "plan",
 "skip_contract_provision_verify": true,
  "category": "community",     "based_onmedication_dispense_period_day": [90
      {
 },
      "identifiermedical_program_settings_text": {"Some text",
         "type"is_active": {true,
      "medication_dispense_allowed": true,
      "codingmedication_dispense_allowed_text": ["Some text",
             {"medication_request_allowed": true,
      "medication_request_allowed_text": "Some text",
       "systemtype": "eHealth/resourcesMEDICATION",
        "funding_source": "NHS",
       "codemr_blank_type": "care_plan"F-1",
      "inserted_at": "2017-04-20T19:14:13Z",
      }
 "inserted_by": "e1453f4c-1077-4e85-8c98-c13ffca0063e",
      "updated_at": "2017-04-20T19:14:13Z",
  ]      "updated_by": "2922a240-63db-404e-b730-09222bfeb2dd"
    },
    "intent": "plan",
    "valuecategory": "9183a36b-4d45-4244-9339-63d81cd08d9c"community",
        }
      },"based_on": [
      {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "activitycare_plan"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
        }
      }     ]},
     "context": {
        "identifier": {
          "type": {
            "coding": [
              {
                "system": "eHealth/resources",
                "code": "encounteractivity"
              }
            ]
          },
          "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      }     },
    "dosage_instruction": [ }
    ],
{         "sequencecontext": 1,
 {
      "text": "0.25mg PO every 6-12 hours as needed for menses from Jan 15-20, 2015.  Do not exceed more than 4mg per day",identifier": {
        "type": {
          "additional_instructioncoding": [
            {
              "codingsystem": "eHealth/resources",
[               {"code": "encounter"
            }
    "system": "eHealth/SNOMED/additional_dosage_instructions",     ]
        },
  "code": "311504000"        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      }
    },
    "dosage_instruction": [
 ]     {
     }         ]"sequence": 1,
        "patient_instructiontext": "0.25mg PO every 6-12 hours as needed for menses from Jan 15-20, 2015.  Do not exceed more than 4mg per day",
        "timingadditional_instruction": [
          {
            "eventcoding": [
              {
                "system"2017-04-20T19:14:13Z": "eHealth/SNOMED/additional_dosage_instructions",
                ],"code": "311504000"
          "repeat": {   }
         "bounds_duration": {  ]
          }
 "value": 10,      ],
        "unitpatient_instruction": "days",
              "system": "eHealth/ucum/units",
     0.25mg PO every 6-12 hours as needed for menses from Jan 15-20, 2015.  Do not exceed more than 4mg per day",
        "codetiming": "d"{
          "event": [
},             "count": 2,"2017-04-20T19:14:13Z"
             "count_max": 4],
            "durationrepeat": 4,{
            "bounds_duration_max": {
 6,             "duration_unitvalue": "d"10,
              "frequencyunit": 1"days",
              "frequency_maxsystem": 2, "eHealth/ucum/units",
              "periodcode": 4,"d"
            "period_max": 6},
            "period_unitcount": "d"2,
            "daycount_of_weekmax": [4,
            "duration": 4,
"mon"             ]"duration_max": 6,
            "timeduration_of_dayunit": ["d",
            "frequency": 1,
 "2017-04-20T19:14:13Z"             ]"frequency_max": 2,
            "whenperiod": [
 4,
            "WAKEperiod_max": 6,
           ] "period_unit": "d",
            "offsetday_of_week": 4[
          },    "mon"
      "code": {     ],
       "coding": [    "time_of_day": [
         {         "2017-04-20T19:14:13Z"
       "system": "TIMING_ABBREVIATIONS",      ],
            "codewhen": "patient"[
              }"WAKE"
            ],
          }  "offset": 4
     },         "as_needed_boolean": true,},
          "sitecode": {
            "coding": [
              {
                "system": "eHealth/SNOMED/anatomical_structure_administration_site_codes",TIMING_ABBREVIATIONS",
                "code": "patient"
              }
         "code": "344001"  ]
          }
        },
 ]         }"as_needed_boolean": true,
        "routesite": {
          "coding": [
            {
              "system": "eHealth/SNOMED/routeanatomical_structure_administration_site_codes",
              "code": "46713006344001"
            }
          ]
        },
        "methodroute": {
          "coding": [
            {
              "system": "eHealth/SNOMED/administrationroute_methodscodes",
              "code": "41974700046713006"
            }
          ]
        },
        "dose_and_rate": {
          "type"method": {
 
          "coding": [

             {
 
              "system": "eHealth/dose_and_rateSNOMED/administration_methods",
 
              "code": "'ordered'419747000"
            }
   }       ]
     ]   },
        },"dose_and_rate": {
          "dose_rangetype": {
            "lowcoding": [
              {
                "valuesystem": 0"eHealth/dose_and_rate",
                "unitcode": "mg",'ordered'"
              }
    "system": "eHealth/ucum/units",       ]
       "code": "mg"  },
          },"dose_range": {
            "highlow": {
              "value": 0,
              "unit": "mg",
              "system": "eHealth/ucum/units",
              "code": "mg"
          
 }           },
          "rate_ratio": {             "numerator"high": {
              "value": 0,
              "unit": "mg",
              "system": "eHealth/ucum/units",
              "code": "mg"
            }
          },,
          "rate_ratio": {
            "denominatornumerator": {
              "value": 0,
              "unit": "mg",
              "system": "eHealth/ucum/units",
              "code": "mg"
            },
          }  "denominator": {
     },         "max_dose_per_periodvalue": {0,
              "numeratorunit": "mg",
 {             "valuesystem": 0,"eHealth/ucum/units",
              "unitcode": "mg",
            }
        "system": "eHealth/ucum/units",
 }
        },
  "code": "mg"           },"max_dose_per_period": {
           "denominatornumerator": {
            "value": 0,
            "unit": "mg",
            "system": "eHealth/ucum/units",
            "code": "mg"
          },
        },         "max_dose_per_administration"denominator": {
            "value": 0,
            "unit": "mg",
            "system": "eHealth/ucum/units",
            "code": "mg"
          }
        },
        "max_dose_per_lifetimeadministration": {
          "value": 0,
          "unit": "mg",
          "system": "eHealth/ucum/units",
          "code": "mg"
        }
      }units",
     ],     "rejected_atcode": "2022-01-28mg",
    "rejected_by": "e8e5a969-74d8-4620-8496-f5e41f2e8312",   },
 "reject_reason": "Incompatible drugs",     "rejectmax_dose_reasonper_codelifetime": "PATIENT_REJECT",{
    "is_blocked": false,     "block_reasonvalue": "Підозра на фрод", 0,
          "block_reason_codeunit": "BLOCK_WRONG_QTY_DRUGmg",
    "block_legal_entity": {
      "idsystem": "UUIDeHealth/ucum/units",
          "typecode": "NHSmg"
        }
      }
    ],
    "priority": "routine",
    "prior_prescription": {
      "identifier": {
        "type": {
          "coding": [
            {
              "system": "eHealth/resources",
              "code": "medication_request"
            }
          ]
        },
        "value": "9183a36b-4d45-4244-9339-63d81cd08d9c"
      }
    },
    "container_dosage": {
      "system": "MEDICATION_UNIT",
      "code": "ML",
      "value": 4
    }
  }
}

Post-processing processes

API paragraph not found

HTTP status codes

idAPI_
Page Properties

HTTP status codes

HTTP status code

Message

What caused the error

...

200

 Response

 

422

 

 validation fails