Skip to content

Instantly share code, notes, and snippets.

@ebarojas
Created October 13, 2020 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebarojas/380f02dd8a18d963f1281c037573ac66 to your computer and use it in GitHub Desktop.
Save ebarojas/380f02dd8a18d963f1281c037573ac66 to your computer and use it in GitHub Desktop.

Flujo

El flujo es el siguiente

  • el api admin crea un hospital, y guarda el id del hospital creado
  • luego crea al medico asignando en el POST el id del hopsital creado
  • listo, el Medic tiene un Hospital asignado

Paso 1

Generación del Hospital

curl --request POST \
  --url <BASE>/api/v2/hospital/ \
  --header 'authorization: Token <ADMIN_TOKEN>’ \
  --header 'content-type: application/json' \
  --data '{
      "name": "My New Hospital",
      "location": "Full Address",
      "is_active": true, # Leave this as true
      "patron": “My Company Name SAPI de CV",
      "headline": “Slogan", # Optional field that appears in printed Rx
      "contact": "MyPhoneNumber, my_contact_email@company.com"
      }'

Paso 2

Generación del Medic con Hospital asignado

curl --request POST \
  --url <BASE>/api/v2/medics/ \
  --header 'authorization: Token <ADMIN_TOKEN>’ \
  --header 'content-type: application/json' \
  --data '{

  "name": "Medic TESTING",
  "password": “my_password”,
  "email": “test@gmail.com",
  "hospital": 7, # Este el id del Hospital que acabamos de crear
  "date_of_birth": "1988-06-10",
  "cedula_prof": "abcqwerty1",
  "specialty_no": "1111112351",
  "specialty": "my_specialty",
  "alma_mater": "my_university",
  "female": false,
  "is_active": true,
  "specialty_verified": true
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment