Skip to content

Instantly share code, notes, and snippets.

@basmoura
Created February 6, 2019 13:20
Show Gist options
  • Save basmoura/507652412dca00ac4cc2bd3b13dfdbed to your computer and use it in GitHub Desktop.
Save basmoura/507652412dca00ac4cc2bd3b13dfdbed to your computer and use it in GitHub Desktop.
STD API

API changes

STD Medical History

There are four new attributes to the json:

  • treated_for_std_past_year_details:

    • Question for patient: 'Please specify:'
    • Type: String
    • Required: true if treated_for_std_past_year is true
  • hiv_infected_or_low_immunity_details:

    • Question for patient: 'Please specify:'
    • Type: String
    • Required: true if hiv_infected_or_low_immunity is "yes"
  • hsv1_hsv2_infected:

    • Question for patient: 'Are you HSV1 or HSV2 infected or have any other condition that might suppress your immune system?'
    • Accepted values: 'yes', 'no', or 'unsure'
    • Type: Array
    • Required: true
  • hsv1_hsv2_infected_details:

    • Question for patient: 'Please specify:'
    • Type: String
    • Required: true if hsv1_hsv2_infected is "yes"
  • first_episode_from_hsv_details:

    • Question for patient: 'Please specify:'
    • Type: String
    • Required: true if hsv1_hsv2_ifirst_episode_from_hsv is "yes"

The API still compatible, if a referral is created with the old JSON format or with the new JSON format, both ways should create a Referral successfully.

Note: Do not mix the old format with the new format. When create a Referral you should use the older or the newer format.

Old JSON Format

{
  "referral": {
    ...
     "medical_data": {
      "allergies": "Dogs, cats",
      "medications": "Aspirin, Ibuprofen",
      "contraindications": "none",
      "medical_history": {
        "positive_test_results": [
          "hsv1",
          "hiv"
        ],
        "international_travel_history": false,
        "international_travel_history_place": "Brazil",
        "born_as": "girl",
        "sexual_partners": [
          "men"
        ],
        "treated_for_std_past_year": false,
        "hiv_infected_or_low_immunity": "yes",
        "can_swallow": "yes",
        "genital_complaints": "????",
        "symptoms_in_the_past_two_weeks": [
          "none"
        ],
        "other_symptoms_in_the_past_two_weeks": "????",
        "pregnant": "no",
        "reason_to_believe_pregnant": "no",
        "genital_symptoms": "???",
        "genital_symptoms_like_a_line": false,
        "genital_symptoms_like_a_line_description": "???",
        "has_or_had_genital_symptoms": true,
        "genital_symptoms_has_tingling_burning": true,
        "genital_symptoms_has_tingling_burning_description": "????",
        "how_severate_symptoms": "mild",
        "first_episode_from_hsv": "yes",
        "panel_include_other_std_tests": "unsure"
      }
    },
    "pharmacy": {
      "id": 11274
    }
  }
}

New JSON Format

{
  "referral": {
    ...
    "medical_data": {
      "allergies": "Dogs, cats",
      "medications": "Aspirin, Ibuprofen",
      "contraindications": "none",
      "medical_history": {
        "positive_test_results": [
          "hsv1",
          "hiv"
        ],
        "international_travel_history": false,
        "international_travel_history_place": "Brazil",
        "born_as": "girl",
        "sexual_partners": [
          "men"
        ],
        "treated_for_std_past_year": false,
        "treated_for_std_past_year_details": "???",
        "hiv_infected_or_low_immunity": "no",
        "hiv_infected_or_low_immunity_details": "???",
        "can_swallow": "yes",
        "genital_complaints": "????",
        "symptoms_in_the_past_two_weeks": [
          "none"
        ],
        "other_symptoms_in_the_past_two_weeks": "????",
        "pregnant": "no",
        "reason_to_believe_pregnant": "no",
        "genital_symptoms": "???",
        "genital_symptoms_like_a_line": false,
        "genital_symptoms_like_a_line_description": "???",
        "has_or_had_genital_symptoms": true,
        "genital_symptoms_has_tingling_burning": true,
        "genital_symptoms_has_tingling_burning_description": "????",
        "how_severate_symptoms": "mild",
        "hsv1_hsv2_infected": "yes",
        "hsv1_hsv2_infected_details": "???",
        "first_episode_from_hsv": "yes",
        "first_episode_from_hsv_details": "????",
        "panel_include_other_std_tests": "unsure"
      }
    },
    "pharmacy": {
      "id": 11274
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment