Prescription
Prescriptions are created by a Medic with a validated account.
List all Prescriptions
This endpoint will list all the prescriptions generated by the Token of the Medic.
The following parameters may be included as part of a URL query string.
Parameter | Description |
---|---|
limit | Number of results to return per page. |
offset | The initial index from which to return the results. |
GET List all Prescriptions
GET /api/v2/rx-endpoint/
import requests
url = "{{Base_URL}}/api/v2/rx-endpoint/"
headers = {
'Authorization': 'Token {{Token}}'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
Response to List all Prescriptions
[StatusCode: 200]
{
"count": 2,
"next": "{{Base_URL}}/api/v2/medics/?limit=15&offset=15",
"previous": null,
"results": [
{
"id": 2714,
"hospital": {
"id": 7,
"patron": "Hospital de Prueba",
"location": "Nombre de la Calle, Colonia, CP, Alcaldia, Estado"
},
"clinic": null,
"medic": "hola@prescrypto.com",
"patient": {
"uid": "1231231-123123-12313-123-123123123",
"name": "Ely de Prescrypto",
"email": "test@prescrpyot.com",
"phone": "",
"date_of_birth": "2000-03-13",
"gender": "M"
},
"diagnosis": "",
"medications": [
{
"id": 393,
"presentation": "Aspirina 30 Tabletas (Ácido Acetilsalicílico 100 mg)",
"instructions": "Tomar una cada 8 horas",
"drug": "Aspirina 30 Tabletas (Ácido Acetilsalicílico 100 mg)",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"category": "standard_drug",
"qty_label": "",
"drug_upc": "1234567890"
}
],
"extras": "",
"signature": "12345678990",
"created_at": "2023-09-07",
"sent": true,
"send_rx": true,
"show_diagnosis": false,
"bought": false,
"rejected": false,
"cta_link": "",
"status": {
"rx_status": [
"available",
"Disponible"
],
"sent_status": [
"sent_email",
"Email enviado"
]
},
"reason_of_rejected": ""
},
{
"id": 2713,
"hospital": {
"id": 7,
"patron": "Hospital de Prueba",
"location": "Nombre de la Calle, Colonia, CP, Alcaldia, Estado"
},
"clinic": null,
"medic": "jason@prescrypto.com",
"patient": {
"uid": "1231231-123123-12313-123-123123123",
"name": "Ely de Prescrypto",
"email": "test@prescrpyto.com",
"phone": "",
"date_of_birth": "2000-03-13",
"gender": "M"
},
"diagnosis": "",
"medications": [
{
"id": 3938,
"presentation": "Aspirina",
"instructions": "Tomar una cada 8 horas",
"drug": "Aspirina 30 Tabletas (Ácido Acetilsalicílico 100 mg)",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"category": "standard_drug",
"qty_label": "",
"drug_upc": "1234567890"
}
],
"extras": "",
"signature": "1234567890",
"created_at": "2023-09-08",
"sent": true,
"send_rx": true,
"show_diagnosis": false,
"bought": false,
"rejected": false,
"cta_link": "",
"status": {
"rx_status": [
"available",
"Disponible"
],
"sent_status": [
"sent_email",
"Email enviado"
]
},
"reason_of_rejected": ""
}
]
}
[Error: 401] Invalid Token
{
"message": "Invalid Token"
}
List a Single Prescription
You can also filter the information for a single prescription, by adding the prescription id to the endpoint route.
GET List a Single Prescription
GET /api/v2/rx-endpoint/{{rx_ID}}
import requests
import json
url = "{{Base_URL}}/api/v2/rx-endpoint/{{rx_ID}}"
headers = {
'Authorization': 'Token {{Token}}'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
Response to List all Prescriptions
[StatusCode: 200]
{
"count": 1,
"next": "{{Base_URL}}/api/v2/medics/?limit=15&offset=15",
"previous": null,
"results": [
{
"id": 2714,
"hospital": {
"id": 7,
"patron": "Hospital de Prueba",
"location": "Nombre de la Calle, Colonia, CP, Alcaldia, Estado"
},
"clinic": null,
"medic": "hola@prescrypto.com",
"patient": {
"uid": "1231231-123123-12313-123-123123123",
"name": "Ely de Prescrypto",
"email": "test@prescrpyot.com",
"phone": "",
"date_of_birth": "2000-03-13",
"gender": "M"
},
"diagnosis": "",
"medications": [
{
"id": 393,
"presentation": "Aspirina",
"instructions": "Tomar una cada 8 horas",
"drug": "Aspirina 30 Tabletas (Ácido Acetilsalicílico 100 mg)",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"category": "standard_drug",
"qty_label": "",
"drug_upc": "1234567890"
}
],
"extras": "",
"signature": "12345678990",
"created_at": "2023-09-07",
"sent": true,
"send_rx": true,
"show_diagnosis": false,
"bought": false,
"rejected": false,
"cta_link": "",
"status": {
"rx_status": [
"available",
"Disponible"
],
"sent_status": [
"sent_email",
"Email enviado"
]
},
"reason_of_rejected": ""
}
]
}
[Error: 404] Prescription not found
{
"message": "Not found"
}
[Error: 401] Invalid Token
{
"message": "Invalid Token"
}
Create a Prescription
####POST Create a Prescription
POST /api/v2/rx-endpoint
import requests
import json
url = "{{Base_URL}}/api/v2/rx-endpoint/"
payload = json.dumps({
"diagnosis": "Gripe por virus de la gripe estacional identificado (1E30)",
"medications": [
{
"presentation": "Ibuprofeno ",
"instructions": "Tomar 1 pastilla cada 8 horas durante 7 dias",
},
{
"presentation": "Aspirina Protect",
"instructions": "Tomar 1 pastilla cada 8 horas durante 7 dias",
}
],
"extras": "Fiebre 38ºC, Cefaleas, escalofrios",
"patient": {
"uid":"123123-12312-12312-123-123123123"
}
})
headers = {
'Authorization': 'Token {{Token}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Response to Create a Prescription
[StatusCode: 200] Success!
{
"id": 123,
"hospital": 1,
"clinic": null,
"medic": "elizabeth@prescrypto.com",
"patient": {
"uid": "123123-12312-12312-123-123123123",
"name": "George Constanza",
"email": "constanza@gmail.com"
},
"diagnosis": "Gripe por virus de la gripe estacional identificado (1E30)",
"medications": [
{
"id": 22,
"presentation": "Ibuprofeno",
"instructions": "Tomar 1 pastilla cada 8 horas durante 7 dias",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"drug_upc": "",
"order_id": 0,
"category": "standard_drug",
"qty_label": "1"
},
{
"id": 23,
"presentation": "Aspirina Protect",
"instructions": "Tomar 1 pastilla cada 8 horas durante 7 dias",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"drug_upc": "",
"order_id": 0,
"category": "standard_drug",
"qty_label": "1"
}
],
"extras": "Fiebre 38ºC, Cefaleas, escalofrios",
"signature": "12sd2jaskjnd13",
"created_at": "2020-06-30",
"sent": null,
"send_rx": true,
"additional_data": {},
"show_diagnosis": false,
"rejected": false,
"bought": false,
"cta_link": ""
}
[Error: 400] The required field field_name is missing
{
"field_name": [
"This field is required."
]
}
[Error: 401] Invalid Token
{
"message": "Invalid Token"
}
Get a Prescription
GET /api/v2/rx-endpoint/{{signature}}/
import requests
url = "<BASE_URL>/api/v2/rx-endpoint/<signature>/"
headers = {
"Content-Type": "application/json",
"Authorization": "Token <TOKEN>"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
Example response
{
"id": 2714,
"hospital": {
"id": 7,
"patron": "Hospital de Prueba",
"location": "Nombre de la Calle, Colonia, CP, Alcaldia, Estado"
},
"clinic": null,
"medic": "hola@prescrypto.com",
"patient": {
"uid": "1231231-123123-12313-123-123123123",
"name": "Ely de Prescrypto",
"email": "test@prescrpyot.com",
"phone": "",
"date_of_birth": "2000-03-13",
"gender": "M"
},
"diagnosis": "",
"medications": [
{
"id": 393,
"presentation": "Aspirina 30 Tabletas (Ácido Acetilsalicílico 100 mg)",
"instructions": "Tomar una cada 8 horas",
"drug": "Aspirina 30 Tabletas (Ácido Acetilsalicílico 100 mg)",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"category": "standard_drug",
"qty_label": "",
"drug_upc": "1234567890"
}
],
"extras": "",
"signature": "12345678990",
"created_at": "2023-09-07",
"sent": true,
"send_rx": true,
"show_diagnosis": false,
"bought": false,
"rejected": false,
"cta_link": "",
"status": {
"rx_status": [
"available",
"Disponible"
],
"sent_status": [
"sent_email",
"Email enviado"
]
},
"reason_of_rejected": ""
}
Resend a Prescription
POST Resend a Prescription
POST /api/v2/rx/resend/{{signature}}/
import requests
import json
url = "{{Base_URL}}/api/v2/rx/resend/{{signature}}/"
payload = json.dumps({
"email": "paciente@prescrypto.com",
"cc": "copia@prescrypto.com"
})
headers = {
'Authorization': 'Token {{Token}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Respose to Resend a Prescription
[StatusCode: 200] Success!
{
"message": "The prescription has been resent, if delivery problems persist, verify that your patient has accepted to receive mail from Prescrypto and that it is not arriving in the spam folder."
}
[Error: 404] Rx not found
{
"message": "Rx not found with signature: 1234567890"
}
[Error: 401] Invalid Token
{
"message": "Invalid Token"
}
Download a Prescription in PDF(Base64)
Prescriptions can be downloaded in their PDF representation with this endpoint, the response will be in base64, which will be needed to decode from base64 to PDF.
GET Download a Prescription
GET /api/v2/rx/pdf/{{eRx_Signature}}/
import requests
url = "{{Base_URL}}/api/v2/rx/pdf/{{eRx_Signature}}/"
headers = {
'Authorization': 'Token {{Token}}',
'Content-Type': 'application/json'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
Respose to Download a Prescription
[StatusCode: 200] Success!
{
"pdf": "pdf_in_base_64"
}
[Error: 404] Rx not found
{
"error": "rx not found"
}
[Error: 401] Invalid Token
{
"message": "Invalid Token"
}
Search Prescription
A Prescription can be searched by the name of the Patient, the email, or the diagnosis.
GET Search Prescription
GET /api/v2/rx-endpoint/?search=Gripe/
import requests
url = "{{Base_URL}}/api/v2/rx-endpoint/?search={{query}}"
headers = {
'Authorization': 'Token {{Token}}'
}
response = requests.request("GET", url, headers=headers)
print(response.text)
Respose to Search Prescription
[StatusCode: 200] Success!
{
"id": 271,
"hospital": {
"id": 25,
"patron": "Hospital de Prueba",
"location": "Nombre de la Calle, Colonia, CP, Alcaldia, Estado"
},
"clinic": null,
"medic": "hola@prescrypto.com",
"patient": {
"uid": "123123-12312-12312-123-123123123",
"name": "Ely de Prescrypto",
"email": "hola@prescrypto.com",
"phone": "",
"date_of_birth": "1983-02-01",
"gender": "M"
},
"diagnosis": "",
"medications": [
{
"id": 23,
"presentation": "Aspirina Protect",
"instructions": "Tomar 1 pastilla cada 8 horas durante 7 dias",
"cost": 0.0,
"bought": false,
"qty": 1,
"bought_qty": 0,
"drug_upc": "",
"order_id": 0,
"category": "standard_drug",
"qty_label": "1"
}
],
"extras": "Indicaciones Extras",
"signature": "12344567890",
"created_at": "2023-09-08",
"sent": null,
"send_rx": true,
"show_diagnosis": false,
"bought": false,
"rejected": false,
"cta_link": "",
"status": {
"rx_status": [
"available",
"Disponible"
],
"sent_status": [
"pending",
"Pendiente de envio"
]
},
"reason_of_rejected": ""
}
[Error: 401] Invalid Token
{
"message": "Invalid Token"
}
[EOF]