NAV
bash javascript

Info

Welcome to EMX API reference.

general

Authorization

Getting the api key

  1. Login to EMX as a hospital administrator under your registered hospital
  2. Click api settings on the left menu
  3. Enter your login password
  4. Copy the generated key to a secure location

Headers

Use the headers as shown below:

  1. Accept: application/json
  2. Authorization: Bearer "Generated api key/token"

Register patient to emx

Example request:

curl -X POST "http://localhost/api/v1/patients/create" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/create",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "message": "Patient created successfully",
    "data": "EMX patient number: ehrfik46"
}

HTTP Request

POST api/v1/patients/create

Query Parameters

Parameter Type Required Description
first_name string Yes Patient first name
last_name string Yes Patient last name
dob date Yes Patient date of birth
address string Yes Patient address
gender integer Yes Patient gender
country integer Yes Patient country
province String Yes Patient province
phone string Yes Patient phone
emergency_contact_name string Yes Patient emergency contact name
emergency_contact_phone string Yes Patient emergency contact phone
city string No Patient city
method_of_communication string No Patient preferred method of communication
zip_code string No Patient zip code
local_government_area string No Patient local government area
hospital_patient_no string No Hospital patient number

Edit registered patient

Example request:

curl -X POST "http://localhost/api/v1/patients/edit" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/edit",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/patients/edit

Query Parameters

Parameter Type Required Description
first_name string Yes Patient first name
last_name string Yes Patient last name
dob date Yes Patient date of birth
address string Yes Patient address
gender integer Yes Patient gender
country integer Yes Patient country
province String Yes Patient province
phone string Yes Patient phone
emergency_contact_name string Yes Patient emergency contact name
emergency_contact_phone string Yes Patient emergency contact phone
city string No Patient city
method_of_communication string No Patient preferred method of communication
zip_code string No Patient zip code
local_government_area string No Patient local government area
emx_patient_no string Sometimes System generated EMX patient number
hospital_patient_no string Sometimes Hospital generated unique patient number

Show patient details by EMX Patient Number

Example request:

curl -X GET "http://localhost/api/v1/patients/show/patient/number/{emx_patient_no}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/show/patient/number/{emx_patient_no}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": {
        "id": 14,
        "emx_patient_no": "ehrfik46",
        "user_id": 40,
        "emergency_contacts": "+254721876543",
        "emergency_contacts_name": "Minor",
        "type": 1,
        "profession": null,
        "home_phone": null,
        "method_of_communication": null,
        "employer_phone": null,
        "pharmacy_name": null,
        "pharmacy_address": null,
        "payment_method": "cash",
        "relation": null,
        "employer_name": null,
        "pharmacy_phone": null,
        "notes": null,
        "created_at": "2018-11-03 13:38:31",
        "updated_at": "2018-11-03 13:38:31",
        "first_name": "theed2",
        "last_name": "pat1",
        "email": "pat1@theed.com",
        "dob": "1992-01-25",
        "phone": "+254712345679"
    }
}

HTTP Request

GET api/v1/patients/show/patient/number/{emx_patient_no}

Query Parameters

Parameter Type Required Description
emx_patient_no string Yes System generated Emx patient Number

Show patient details by Hospital Patient Number

Example request:

curl -X GET "http://localhost/api/v1/patients/show/patient/number/{hospital_patient_no}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/show/patient/number/{emx_patient_no}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": {
        "id": 14,
        "emx_patient_no": "ehrfik46",
        "user_id": 40,
        "emergency_contacts": "+254721876543",
        "emergency_contacts_name": "Minor",
        "type": 1,
        "profession": null,
        "home_phone": null,
        "method_of_communication": null,
        "employer_phone": null,
        "pharmacy_name": null,
        "pharmacy_address": null,
        "payment_method": "cash",
        "relation": null,
        "employer_name": null,
        "pharmacy_phone": null,
        "notes": null,
        "created_at": "2018-11-03 13:38:31",
        "updated_at": "2018-11-03 13:38:31",
        "first_name": "theed2",
        "last_name": "pat1",
        "email": "pat1@theed.com",
        "dob": "1992-01-25",
        "phone": "+254712345679"
    }
}

HTTP Request

GET api/v1/patients/show/patient/number/{hospital_patient_no}

Query Parameters

Parameter Type Required Description
hospital_patient_no string Yes Hospital Patient Number

Show patient details by Patient Phone Number

Example request:

curl -X GET "http://localhost/api/v1/patients/show/patient/phone/{phone}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/show/patient/phone/{phone}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": {
        "id": 14,
        "emx_patient_no": "ehrfik46",
        "user_id": 40,
        "emergency_contacts": "+254721876543",
        "emergency_contacts_name": "Minor",
        "type": 1,
        "profession": null,
        "home_phone": null,
        "method_of_communication": null,
        "employer_phone": null,
        "pharmacy_name": null,
        "pharmacy_address": null,
        "payment_method": "cash",
        "relation": null,
        "employer_name": null,
        "pharmacy_phone": null,
        "notes": null,
        "created_at": "2018-11-03 13:38:31",
        "updated_at": "2018-11-03 13:38:31",
        "first_name": "theed2",
        "last_name": "pat1",
        "email": "pat1@theed.com",
        "dob": "1992-01-25",
        "phone": "+254712345679"
    }
}

HTTP Request

GET api/v1/patients/show/patient/phone/{phone}

Query Parameters

Parameter Type Required Description
phone string Yes Patient Phone Number

Add patient record

Required fields: note_type, record,

Example request:

                {
	"records": [{
			"note_type": "Chief Complaints",
			"record": {
				"Chief Complaints": "Fatigue",
				"Notes": "Burnout"
			}
		},
		{
			"note_type": "History Of Present Illness",
			"record": {
				"Diagnosis": "Fatigue",
				"Notes": "Burnout"
			}
		},
		{
			"note_type": "Vitals",
			"record": {
				"Height(cm)": "Last week",
				"Weight(kg)": "65",
				"BMI": "25",
				"BP": "100/70",
				"Temperature ( °c)": "35",
				"Pulse": "60",
				"Respiratory Rate": "15",
				"Pain level (0-10)": "1"
			}
		}
	],
	"emx_patient_no": "ehrxxxxxxx",
	"emx_doctor_no": "drxxxxxxx"
}
            
curl -X POST "http://localhost/api/v1/patients/add/doctors/note" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/add/doctors/note",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/patients/add/doctors/note

Query Parameters

Parameter Type Required Description
records json Yes Array of note types and notes with paramenters. Refer to doctor's note types for parameter fields
emx_patient_no string Sometimes System generated Emx patient number
hospital_patient_no string Sometimes Hospital generated unique patient number
emx_doctor_no string Sometimes System generated Emx doctor number
external_doctor_no string Sometimes Hospital generated unique doctor number

Doctor's note types

Example request:

curl -X GET "http://localhost/api/v1/patients/fetch/note/types" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/fetch/note/types",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": {
        "Chief Complaints": {
            "note_parameters": [
                {
                    "name": "Chief Complaints"
                },
                {
                    "name": "Notes"
                }
            ]
        },
        "History Of Present Illness": {
            "note_parameters": [
                {
                    "name": "HPI"
                },
                {
                    "name": "Notes"
                }
            ]
        },
        "Vitals": {
            "note_parameters": [
                {
                    "name": "Height(cm)"
                },
                {
                    "name": "Weight(kg)"
                },
                {
                    "name": "BMI"
                },
                {
                    "name": "BP"
                },
                {
                    "name": "Temperature ( °c)"
                },
                {
                    "name": "Pulse"
                },
                {
                    "name": "Respiratory Rate"
                },
                {
                    "name": "Pain level (0-10)"
                }
            ]
        },
        "Allergies": {
            "note_parameters": [
                {
                    "name": "Allergies"
                },
                {
                    "name": "Notes"
                }
            ]
        },
        "Current Medications": {
            "note_parameters": [
                {
                    "name": "Medications"
                },
                {
                    "name": "Notes"
                }
            ]
        },
        "Past Medical History": {
            "note_parameters": [
                {
                    "name": "Past Medical History"
                },
                {
                    "name": "Notes"
                }
            ]
        },
        "Family History": {
            "note_parameters": [
                {
                    "name": "Family History"
                }
            ]
        },
        "Social History": {
            "note_parameters": [
                {
                    "name": "Social History"
                }
            ]
        },
        "Previous Screenings": {
            "note_parameters": [
                {
                    "name": "Previous Screenings"
                }
            ]
        },
        "Review Of Systems": {
            "note_parameters": [
                {
                    "name": "Constitutional"
                },
                {
                    "name": "Constitutional Notes"
                },
                {
                    "name": "Eyes"
                },
                {
                    "name": "Eyes Notes"
                },
                {
                    "name": "Ears"
                },
                {
                    "name": "Ears Notes"
                },
                {
                    "name": "Nose"
                },
                {
                    "name": "Nose notes"
                },
                {
                    "name": "Mouth/Throat"
                },
                {
                    "name": "Mouth/Throat Notes"
                },
                {
                    "name": "Cardiovascular"
                },
                {
                    "name": "Cardiovascular Notes"
                },
                {
                    "name": "Respiratory"
                },
                {
                    "name": "Respiratory Notes"
                },
                {
                    "name": "Gastrointestinal"
                },
                {
                    "name": "Gastrointestinal Notes"
                },
                {
                    "name": "Genitourinary"
                },
                {
                    "name": "Genitourinary Notes"
                },
                {
                    "name": "Musculoskeletal"
                },
                {
                    "name": "Musculoskeletal Notes"
                },
                {
                    "name": "Skin"
                },
                {
                    "name": "Skin Notes"
                },
                {
                    "name": "Neurologic"
                },
                {
                    "name": "Neurologic Notes"
                },
                {
                    "name": "Psychiatric"
                },
                {
                    "name": "Psychiatric Notes"
                },
                {
                    "name": "Endocrine"
                },
                {
                    "name": "Endocrine Notes"
                },
                {
                    "name": "Hematologic/Lymphatic"
                },
                {
                    "name": "Hematologic/Lymphatic Notes"
                },
                {
                    "name": "Allergy/Immunologic"
                },
                {
                    "name": "Allergy/Immunologic Notes"
                }
            ]
        },
        "Physical Examination": {
            "note_parameters": [
                {
                    "name": "General Apperarance"
                },
                {
                    "name": "General Appearance Notes"
                },
                {
                    "name": "Level Of Distress"
                },
                {
                    "name": "Level Of Distress Notes"
                },
                {
                    "name": "Ambulation"
                },
                {
                    "name": "Ambulation Notes"
                },
                {
                    "name": "Insight"
                },
                {
                    "name": "Insight Notes"
                },
                {
                    "name": "Mental Status"
                },
                {
                    "name": "Mental Status Notes"
                },
                {
                    "name": "Orientation"
                },
                {
                    "name": "Orientation Notes"
                },
                {
                    "name": "Memory"
                },
                {
                    "name": "Memory Notes"
                },
                {
                    "name": "Head"
                },
                {
                    "name": "Head Notes"
                },
                {
                    "name": "Lids and Conjunctivae"
                },
                {
                    "name": "Lids and Conjunctivae Notes"
                },
                {
                    "name": "Pupils"
                },
                {
                    "name": "Pupils Notes"
                },
                {
                    "name": "Corneas"
                },
                {
                    "name": "Corneas"
                },
                {
                    "name": "Fundoscopic"
                },
                {
                    "name": "Fundoscopic Notes"
                },
                {
                    "name": "EOM"
                },
                {
                    "name": "EOM Notes"
                },
                {
                    "name": "Lens"
                },
                {
                    "name": "Lens Notes"
                },
                {
                    "name": "Sclerae"
                },
                {
                    "name": "Slerae Notes"
                },
                {
                    "name": "Vision"
                },
                {
                    "name": "Vision Notes"
                },
                {
                    "name": "Ears"
                },
                {
                    "name": "Ears Notes"
                },
                {
                    "name": "Hearing"
                },
                {
                    "name": "Hearing Notes"
                },
                {
                    "name": "Nose"
                },
                {
                    "name": "Nose Notes"
                },
                {
                    "name": "Lips, Teeth, and Gums"
                },
                {
                    "name": "Lips, Teeth, and Gums Notes"
                },
                {
                    "name": "Oropharynx"
                },
                {
                    "name": "Oropharynx Notes"
                },
                {
                    "name": "Neck"
                },
                {
                    "name": "Neck Notes"
                },
                {
                    "name": "Lymph Nodes"
                },
                {
                    "name": "Lymph Nodes Notes"
                },
                {
                    "name": "Thyroid"
                },
                {
                    "name": "Thyroid Notes"
                },
                {
                    "name": "Respiratory effort"
                },
                {
                    "name": "Respiratory Effort Notes"
                },
                {
                    "name": "Percussion"
                },
                {
                    "name": "Percussion Notes"
                },
                {
                    "name": "Auscultation"
                },
                {
                    "name": "Auscultation Notes"
                },
                {
                    "name": "Apical Impulse"
                },
                {
                    "name": "Apical Impulse Notes"
                },
                {
                    "name": "Heart Auscultation"
                },
                {
                    "name": "Heart Auscultation Notes"
                },
                {
                    "name": "Neck vessels"
                },
                {
                    "name": "Neck vessels Notes"
                },
                {
                    "name": "Pulses including femoral / pedal"
                },
                {
                    "name": "Pulses including femoral / pedal Notes"
                },
                {
                    "name": "Bowel Sounds"
                },
                {
                    "name": "Bowel Sounds Notes"
                },
                {
                    "name": "Inspection and Palpation"
                },
                {
                    "name": "Inspection and Palpation Notes"
                },
                {
                    "name": "Liver"
                },
                {
                    "name": "Liver Notes"
                },
                {
                    "name": "Spleen"
                },
                {
                    "name": "Spleen Notes"
                },
                {
                    "name": "Hernia"
                },
                {
                    "name": "Hernia Notes"
                },
                {
                    "name": "Penis"
                },
                {
                    "name": "Penis Notes"
                },
                {
                    "name": "Scrotum"
                },
                {
                    "name": "Scrotum Notes"
                },
                {
                    "name": "Testes"
                },
                {
                    "name": "Testes Notes"
                },
                {
                    "name": "Prostate"
                },
                {
                    "name": "Prostate Notes"
                },
                {
                    "name": "Anus, Perineum, Rectum"
                },
                {
                    "name": "Anus, Perineum, Rectum Notes"
                },
                {
                    "name": "Motor Strength and Tone"
                },
                {
                    "name": "Motor Strength and Tone Notes"
                },
                {
                    "name": "Joints, Bones, and Muscles"
                },
                {
                    "name": "Joints, Bones, and Muscles Notes"
                },
                {
                    "name": "Extremities"
                },
                {
                    "name": "Extremities Notes"
                },
                {
                    "name": "Gait and Station"
                },
                {
                    "name": "Gait and Station Notes"
                },
                {
                    "name": "Cranial Nerves"
                },
                {
                    "name": "Cranial Nerves Notes"
                },
                {
                    "name": "Sensation"
                },
                {
                    "name": "Sensation Notes"
                },
                {
                    "name": "Reflexes"
                },
                {
                    "name": "Reflexes Notes"
                },
                {
                    "name": "Coordination and Cerebellum"
                },
                {
                    "name": "Coordination and Cerebellum Notes"
                },
                {
                    "name": "Inspection and palpation"
                },
                {
                    "name": "Inspection and palpation Notes"
                },
                {
                    "name": "Nails"
                },
                {
                    "name": "Nails Notes"
                },
                {
                    "name": "Thoracolumbar Appearance"
                },
                {
                    "name": "Thoracolumbar Appearance Notes"
                }
            ]
        },
        "Assessment": {
            "note_parameters": [
                {
                    "name": "Diagnosis"
                },
                {
                    "name": "Notes"
                }
            ]
        }
    }
}

HTTP Request

GET api/v1/patients/fetch/note/types

Schedule a patient visit

Example request:

curl -X POST "http://localhost/api/v1/patients/schedule/visit" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/schedule/visit",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/patients/schedule/visit

Query Parameters

Parameter Type Required Description
schedule_date date Yes Schedule date format: Y-m-d
from_time string Yes Appointment start time
to_time string Yes Appointment end time
schedule_type string Yes Type of schedule from schedule type list
emx_patient_no string Sometimes System generated unique Emx patient number
hospital_patient_no string Sometimes Hospital generated unique patient number
emx_doctor_no string Sometimes System generated unique Emx doctor number
external_doctor_no string Sometimes Hospital generated unique External doctor number

Patient visist schedule types

Example request:

curl -X GET "http://localhost/api/v1/patients/schedule/types" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/schedule/types",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "name": "Follow Up Visit"
        },
        {
            "id": 2,
            "name": "New Patient Visit"
        },
        {
            "id": 3,
            "name": "Walk In"
        }
    ]
}

HTTP Request

GET api/v1/patients/schedule/types

Patient visit schedule list

Example request:

curl -X GET "http://localhost/api/v1/schedules/list" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/schedules/li",st
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "message": "Last 100 schedules fetched",
    "data": [
        {
            "time": "18:0to18:15",
            "event_date": "2018-12-04",
            "reason": "Headache",
            "external_visit_id": null,
            "external_department": null,
            "first_name": "theed2",
            "last_name": "pat1",
            "emx_patient_no": "ehrfik46",
            "external_patient_number": null,
        }
    ]
}

HTTP Request

GET api/v1/schedules/list

List of registered doctors

Example request:

curl -X GET "http://localhost/api/v1/doctors" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/doctors",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": [],
    "links": {
        "first": "http:\/\/staging.emx.md\/api\/v1\/doctors?page=1",
        "last": "http:\/\/staging.emx.md\/api\/v1\/doctors?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "path": "http:\/\/staging.emx.md\/api\/v1\/doctors",
        "per_page": 10,
        "to": null,
        "total": 0
    }
}

HTTP Request

GET api/v1/doctors

Register a Doctor

Example request:

curl -X POST "http://localhost/api/v1/doctors/create" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/doctors/create",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/doctors/create

Query Parameters

Parameter Type Required Description
first_name string Yes Doctor first name
last_name string Yes Doctor last name
email string Yes Doctor email
dob date No Doctor date of birth
address string No Doctor address
gender integer No Doctor gender 1: male 2: female
country integer Yes Doctor country of operation
province string Yes Doctor province/state of operation
city string No Doctor city of operation
phone string No Doctor phone
zip_code string No Doctor zip code
local_government_area string No Doctor local government area
external_doctor_no string sometimes Hospital doctor unique identifier

Edit Doctor's info

Example request:

curl -X POST "http://localhost/api/v1/doctors/edit" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/doctors/edit",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

HTTP Request

POST api/v1/doctors/edit

Query Parameters

Parameter Type Required Description
first_name string Yes Doctor first name
last_name string Yes Doctor last name
email string Yes Doctor email
dob date Yes Doctor date of birth
address string Yes Doctor address
gender integer Yes Doctor gender
country integer Yes Doctor country of operation
province string Yes Doctor province/state of operation
phone string Yes Doctor phone
emx_doc_no string No System generated EMX doctor number
external_doc_no string No Hospital generated unique doctor number
zip_code string No Doctor zip code
local_government_area string No Doctor local government area

Show doctor by EMX doctor number

Example request:

curl -X GET "http://localhost/api/v1/doctors/show/{emx_doc_no}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/doctors/show/{emx_doc_no}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": {
        "emx_doc_no": "drrxddgx",
        "first_name": "John",
        "last_name": "Doe",
        "email": "example@hospital.com",
        "phone": "07108938011"
    }
}

HTTP Request

GET api/v1/doctors/show/{emx_doc_no}

List pharmacies

Example request:

curl -X GET "http://localhost/api/v1/pharmacies" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "name": "Chemist",
            "email": "chemist@emx.md",
            "geo_location": null,
            "address": "kindaruma road, blue violet plaza, 306",
            "country": 3,
            "state_province": "Nairobi",
            "zip_code": "00200",
            "street": "Joseph Kangethe",
            "branch_type": 1,
            "created_at": "2018-05-17 05:01:03",
            "updated_at": "2018-05-17 05:01:03",
            "latitude": "-1.297305",
            "longitude": "36.786917"
        }
    ],
    "links": {
        "first": "http:\/\/staging.emx.md\/api\/v1\/pharmacies?page=1",
        "last": "http:\/\/staging.emx.md\/api\/v1\/pharmacies?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "http:\/\/staging.emx.md\/api\/v1\/pharmacies",
        "per_page": 10,
        "to": 1,
        "total": 1
    }
}

HTTP Request

GET api/v1/pharmacies

Create a new pharmacy

Query Parameters

Parameter Type Required Description
name string Yes Pharmacy name
email string Yes Pharmacy email
address string Yes Pharmacy address
country integer Yes Pharmacy country of operation
state string Yes Pharmacy province/state of operation
street string Yes Pharmacy street
zip_code string No Pharmacy zip code
branch_type string No 1. for main branch 2. for sub branch
latitude string No Pharmacy latitude
longitude string No Pharmacy longitude

Example request:

curl -X POST "http://localhost/api/v1/pharmacies/create" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies/create",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:


     {
       "status": "success",
       "message": "Pharmacy created successfully",
       "data": {
          "pharmacy_id": 8
        }
     }
            

HTTP Request

POST api/v1/pharmacies/create

Edit Pharmacy

Query Parameters

Parameter Type Required Description
name string Yes Pharmacy name
email string Yes Pharmacy email
address string Yes Pharmacy address
country integer Yes Pharmacy country of operation
state string Yes Pharmacy province/state of operation
street string Yes Pharmacy street
pharmacy_id integer yes id of the pharmacy being edited
zip_code string No Pharmacy zip code
branch_type string No 1. for main branch 2. for sub branch
latitude string No Pharmacy latitude
longitude string No Pharmacy longitude

Example request:

curl -X POST "http://localhost/api/v1/pharmacies/edit" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies/edit",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:


     {
       "status": "success",
       "message": "Pharmacy edited successfully",
       "data": {
         "pharmacy_id": 8
       }
     }
            

HTTP Request

POST api/v1/pharmacies/edit

Search medications from EMX meds database

Example request:

curl -X GET "http://localhost/api/v1/pharmacies/medications/{phrase}" \
-H "Accept: application/json"
var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies/medications/{phrase}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});

Example response:

{
    "status": "success",
    "data": [
        {
            "suggestion_name": "Carboplatin (Paraplatin)- FDA"
        },
        {
            "suggestion_name": "Carboplatin (Paraplatin)- Multum"
        },
        {
            "suggestion_name": "Paraplatin (Carboplatin)- FDA"
        },
        {
            "suggestion_name": "Paraplatin (Carboplatin)- Multum"
        }
    ]
}

HTTP Request

GET api/v1/pharmacies/medications/{phrase}

Prescribe medication

HTTP Request

POST api/v1/pharmacies/prescribe

Query Parameters

Parameter Type Required Description
med_name string Yes Name of medication
frequency string Yes Number of times a day e.g. 1x3
quantity string Yes Amount of medication
start_date date Yes Medication start date (Date format: yyyy-mm-dd)
end_date date Yes Medication end date (Date format: yyyy-mm-dd)
route string Yes Oral/intravenous
emx_patient_no string Sometimes System generated EMX patient number
hospital_patient_no string Sometimes Hospital generated unique patient number

Example request:

            curl -X POST "http://localhost/api/v1/pharmacies/prescribe" \
-H "Accept: application/json"
            
        
            var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies/prescribe",
    "method": "POST",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
            
        

List Prescriptions By EMX patient number

Example request:

            
                curl -X GET "http://localhost/api/v1/pharmacies/fetch/prescriptions/{emx_patient_no}" \
-H "Accept: application/json"
            
        
            var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies/fetch/prescriptions/{emx_patient_no}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
            
        

Example response:

            {
    "status": "success",
    "data": [
        {
            "id": 29,
            "prescription": "Aspirin (Bayer)- FDA",
            "frequency": "1x1",
            "quantity": "14",
            "route": "Oral",
            "notes": null,
            "start_date": "2019-06-05",
            "end_date": "2019-06-19",
            "updated_at": "2019-06-04 10:59:02",
            "status_name": "Prescribed"
        },
        {
            "id": 28,
            "prescription": "Amoxicillin (Amoxil)- FDA",
            "frequency": "1x3",
            "quantity": "21",
            "route": "Oral",
            "notes": null,
            "start_date": "2019-06-05",
            "end_date": "2019-06-12",
            "updated_at": "2019-06-04 09:58:21",
            "status_name": "Prescribed"
        },
        {
            "id": 6,
            "prescription": "Amoxicillin (Amoxil)- FDA",
            "frequency": "1x2",
            "quantity": "14",
            "route": "Tablets",
            "notes": null,
            "start_date": "2018-06-14",
            "end_date": "2018-06-28",
            "updated_at": "2018-06-15 13:47:24",
            "status_name": "Prescribed"
        },
        {
            "id": 2,
            "prescription": "Amoxil (Amoxicillin)- FDA\n",
            "frequency": null,
            "quantity": null,
            "route": null,
            "notes": null,
            "start_date": null,
            "end_date": null,
            "updated_at": "2018-05-17 05:34:15",
            "status_name": "Pending"
        }
    ]
}

HTTP Request

GET api/v1/pharmacies/fetch/prescriptions/{emx_patient_no}

List Prescriptions By Hospital unique patient number

Example request:

            
                curl -X GET "http://localhost/api/v1/pharmacies/fetch/prescriptions/external/{external_patient_no}" \
-H "Accept: application/json"
            
        
            var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/pharmacies/fetch/prescriptions/external/{external_patient_no}",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
            
        

Example response:

            {
    "status": "success",
    "data": [
        {
            "id": 29,
            "prescription": "Aspirin (Bayer)- FDA",
            "frequency": "1x1",
            "quantity": "14",
            "route": "Oral",
            "notes": null,
            "start_date": "2019-06-05",
            "end_date": "2019-06-19",
            "updated_at": "2019-06-04 10:59:02",
            "status_name": "Prescribed"
        },
        {
            "id": 28,
            "prescription": "Amoxicillin (Amoxil)- FDA",
            "frequency": "1x3",
            "quantity": "21",
            "route": "Oral",
            "notes": null,
            "start_date": "2019-06-05",
            "end_date": "2019-06-12",
            "updated_at": "2019-06-04 09:58:21",
            "status_name": "Prescribed"
        },
        {
            "id": 6,
            "prescription": "Amoxicillin (Amoxil)- FDA",
            "frequency": "1x2",
            "quantity": "14",
            "route": "Tablets",
            "notes": null,
            "start_date": "2018-06-14",
            "end_date": "2018-06-28",
            "updated_at": "2018-06-15 13:47:24",
            "status_name": "Prescribed"
        },
        {
            "id": 2,
            "prescription": "Amoxil (Amoxicillin)- FDA\n",
            "frequency": null,
            "quantity": null,
            "route": null,
            "notes": null,
            "start_date": null,
            "end_date": null,
            "updated_at": "2018-05-17 05:34:15",
            "status_name": "Pending"
        }
    ]
}

HTTP Request

GET api/v1/pharmacies/fetch/prescriptions/external/{external_patient_no}

List of Countries

Example request:

            
                curl -X GET "http://localhost/api/v1/patients/countries" \
-H "Accept: application/json"
            
        
            var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/countries",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
            
        

Example response:

            {
    "status": "success",
    "data": [
        {
            "id": 119,
            "county_name": "Kenya",
            "calling_code": "254"
        }
    ]
}

HTTP Request

GET api/v1/patients/countries

List of genders

Example request:

            
                curl -X GET "http://localhost/api/v1/patients/gender" \
-H "Accept: application/json"
            
        
            var settings = {
    "async": true,
    "crossDomain": true,
    "url": "http://localhost/api/v1/patients/gender",
    "method": "GET",
    "headers": {
        "accept": "application/json"
    }
}

$.ajax(settings).done(function (response) {
    console.log(response);
});
            
        

Example response:

{
    "status": "success",
    "data": [
        {
            "id": 1,
            "gender_name": "Male"
        },
        {
            "id": 2,
            "gender_name": "Female"
        }
    ]
}
            

HTTP Request

GET api/v1/patients/gender