npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

biotoken-begood

v0.1.5

Published

The begood-sdk is a library that provides various functionalities for interacting with the BeGood platform. It allows you to easily integrate healthcare data with BeGood and leverage its features.

Downloads

211

Readme

BeGood SDK

Introduction

The begood-sdk is a library that provides various functionalities for interacting with the BeGood platform. It allows you to easily integrate healthcare data with BeGood and leverage its features.

Installation

You can install the begood-sdk package

npm i biotoken-begood

Instruction

  1. List item

    Initialize Begood object:

    import  Begood  from  "biotoken-begood";
        
    const  begood  =  new  Begood({
        apiKey:  'your organization api key, please contact Begood admins to get this data'
    });
  2. Call functions

    async  function  addPatient() {
    	return await begood.addPatient({
    		resourceType:  'Patient',
    		patientId:  '20000',
    		name: [{
    			family:  'Doe',
    			given: ['Joe']
    		}],
    		gender:  'male',
    		birthDate:  '1990-01-01'
    	});
    }
  3. Example Data

    1. Example Data

    Here are example objects for each of the 12 categories:

    • addPatient:
    {
        "resourceType": "Patient",
        "patientId": "595283",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2020-01-31T06:39:44.424+00:00",
          "source": "#UglRum1megqyeh5O"
        },
        "text": {
          "status": "generated",
          "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><div class=\"hapiHeaderText\">Chong <b>SHEN </b></div><table class=\"hapiPropertyTable\"><tbody><tr><td>Identifier</td><td>cshen89</td></tr><tr><td>Address</td><td><span>1234 hot ln </span><br/><span>Boulder </span><span>MA </span><span>US </span></td></tr><tr><td>Date of birth</td><td><span>17 July 1977</span></td></tr></tbody></table></div>"
        },
        "identifier": [
          {
            "value": "cshen89",
            "period": {
              "start": "2018-12-06"
            }
          }
        ],
        "name": [
          {
            "family": "Shen",
            "given": [
              "Chong"
            ]
          }
        ],
        "telecom": [
          {
            "value": "(303)-217-7766",
            "use": "home"
          }
        ],
        "gender": "male",
        "birthDate": "1977-07-17",
        "address": [
          {
            "use": "home",
            "line": [
              "1234 hot ln"
            ],
            "city": "Boulder",
            "state": "MA",
            "postalCode": "12345",
            "country": "US"
          }
        ]
      }
    • addAppointment:
       {
            "resourceType": "Appointment",
            "appointmentId": "87013",
            "meta": {
              "versionId": "1",
              "lastUpdated": "2019-11-22T09:35:54.778+00:00",
              "source": "#xwpAbPyHZi4Jeobq"
            },
            "text": {
              "status": "generated",
              "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Brian MRI results discussion</div>"
            },
            "status": "booked",
            "serviceCategory": [
              {
                "coding": [
                  {
                    "system": "http://example.org/service-category",
                    "code": "gp",
                    "display": "General Practice"
                  }
                ]
              }
            ],
            "serviceType": [
              {
                "coding": [
                  {
                    "code": "52",
                    "display": "General Discussion"
                  }
                ]
              }
            ],
            "specialty": [
              {
                "coding": [
                  {
                    "system": "http://snomed.info/sct",
                    "code": "394814009",
                    "display": "General practice"
                  }
                ]
              }
            ],
            "appointmentType": {
              "coding": [
                {
                  "system": "http://terminology.hl7.org/CodeSystem/v2-0276",
                  "code": "FOLLOWUP",
                  "display": "A follow up visit from a previous appointment"
                }
              ]
            },
            "reasonReference": [
              {
                "display": "Severe burn of left ear"
              }
            ],
            "priority": 5,
            "description": "Discussion on the results of your recent MRI",
            "start": "2013-12-10T09:00:00Z",
            "end": "2013-12-10T11:00:00Z",
            "created": "2013-10-10",
            "comment": "Further expand on the results of the MRI and determine the next actions that may be appropriate.",
            "participant": [
              {
                "actor": {
                  "reference": "Patient/" + patientId,
                },
                "required": "required",
                "status": "accepted"
              },
              {
                "type": [
                  {
                    "coding": [
                      {
                        "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
                        "code": "ATND"
                      }
                    ]
                  }
                ],
                "actor": {
                  "display": "Dr Adam Careful"
                },
                "required": "required",
                "status": "accepted"
              },
              {
                "actor": {
                  "display": "South Wing, second floor"
                },
                "required": "required",
                "status": "accepted"
              }
            ]
          }
    • addCondition:
     {
            "resourceType": "Condition",
            "conditionId": "39393",
            "meta": {
              "versionId": "1",
              "lastUpdated": "2019-10-01T18:20:52.229+00:00",
              "source": "#d5cd41857280ffbe"
            },
            "clinicalStatus": {
              "coding": [
                {
                  "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
                  "code": "active"
                }
              ]
            },
            "verificationStatus": {
              "coding": [
                {
                  "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
                  "code": "confirmed"
                }
              ]
            },
            "category": [
              {
                "coding": [
                  {
                    "system": "http://snomed.info/sct",
                    "code": "55607006",
                    "display": "Problem"
                  },
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/condition-category",
                    "code": "problem-list-item"
                  }
                ]
              }
            ],
            "severity": {
              "coding": [
                {
                  "system": "http://snomed.info/sct",
                  "code": "255604002",
                  "display": "Mild"
                }
              ]
            },
            "code": {
              "coding": [
                {
                  "system": "http://snomed.info/sct",
                  "code": "386661006",
                  "display": "Fever"
                }
              ]
            },
            "bodySite": [
              {
                "coding": [
                  {
                    "system": "http://snomed.info/sct",
                    "code": "38266002",
                    "display": "Entire body as a whole"
                  }
                ]
              }
            ],
            "subject": {
              "reference": "Patient/" + patientId,
              "display": "Roel"
            },
            "onsetDateTime": "2013-04-02",
            "abatementString": "around April 9, 2013",
            "recordedDate": "2019-04-04",
            "recorder": {
              "reference": "Practitioner/1058"
            },
            "asserter": {
              "reference": "Practitioner/1058"
            },
            "evidence": [
              {
                "code": [
                  {
                    "coding": [
                      {
                        "system": "http://snomed.info/sct",
                        "code": "258710007",
                        "display": "degrees C"
                      }
                    ]
                  }
                ],
                "detail": [
                  {
                    "display": "Temperature"
                  }
                ]
              }
            ]
        }
    • addProcedure:
    {
        "resourceType": "Procedure",
        "procedureId": "39797",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-10-03T11:32:19.423+00:00",
          "source": "#7afaa86051c4eba3"
        },
        "status": "completed",
        "code": {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "52734007",
              "display": "Total hip replacement"
            }
          ],
          "text": "52734007"
        },
        "subject": {
          "reference": "Patient/39254"
        },
        "performedDateTime": "2000-03-28"
      }
    • addObservation:
    {
      "resourceType" : "Observation",
      "id" : "heart-rate",
      "meta" : {
        "profile" : ["http://hl7.org/fhir/StructureDefinition/vitalsigns"]
      },
      "status" : "final",
      "category" : [{
        "coding" : [{
          "system" : "http://terminology.hl7.org/CodeSystem/observation-category",
          "code" : "vital-signs",
          "display" : "Vital Signs"
        }],
        "text" : "Vital Signs"
      },
      {
        "coding" : [{
          "system" : "http://loinc.org",
          "code" : "8867-4",
          "display" : "Heart rate"
        }],
        "text" : "Heart rate"
      }],
      "code" : {
        "coding" : [{
          "system" : "http://loinc.org",
          "code" : "8867-4",
          "display" : "Heart rate"
        }],
        "text" : "Heart rate"
      },
      "subject" : {
        "reference" : "Patient/" + patientId
      },
      "effectiveDateTime" : "1999-07-02",
      "valueQuantity" : {
        "value" : 44,
        "unit" : "beats/minute",
        "system" : "http://unitsofmeasure.org",
        "code" : "/min"
      }
    }
    • addAllergyIntolerance:
    {
        "resourceType": "AllergyIntolerance",
        "allergyIntoleranceId": "53342",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-11-01T21:53:29.077+00:00",
          "source": "#1l3hYmrDBOUuDZ2f"
        },
        "verificationStatus": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/ValueSet/allergyintolerance-verification",
              "code": "confirmed",
              "display": "Confirmed"
            }
          ],
          "text": " AllergyIntoleranceVerificationStatusCodes"
        },
        "type": "allergy",
        "code": {
          "coding": [
            {
              "system": "2.16.840.1.113883.6.96",
              "code": "419511003",
              "display": "Propensity to adverse reaction to drug"
            }
          ]
        },
        "patient": {
          "reference": "Patient/53373",
          "type": "Patient"
        },
        "onsetPeriod": {
          "start": "1980-05-01"
        },
        "reaction": [
          {
            "substance": {
              "coding": [
                {
                  "system": "2.16.840.1.113883.6.88",
                  "code": "81953",
                  "display": "Ampicillin"
                }
              ]
            },
            "manifestation": [
              {
                "coding": [
                  {
                    "system": "2.16.840.1.113883.6.96",
                    "code": "247472004",
                    "display": "Hives"
                  }
                ]
              }
            ]
          }
        ]
      }
    • addImmunization:
    {
        "resourceType": "Immunization",
        "immunizationId": "49251",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-10-18T20:20:56.872+00:00",
          "source": "#ML8v9Ku1pGuXAhZr"
        },
        "status": "completed",
        "vaccineCode": {
          "coding": [
            {
              "system": "http://hl7.org/fhir/sid/cvx",
              "code": "140",
              "display": "Influenza, seasonal, injectable, preservative free"
            }
          ],
          "text": "Influenza, seasonal, injectable, preservative free"
        },
        "patient": {
          "reference": "Patient/49006"
        },
        "encounter": {
          "reference": "Encounter/49229"
        },
        "occurrenceDateTime": "2013-04-01T20:27:01-04:00",
        "primarySource": true
      }
    • addMedicationAdministration:
    {
      "resourceType": "MedicationAdministration",
      "id": "medadmin0310",
      "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: medadmin0310</p><p><b>contained</b>: </p><p><b>status</b>: completed</p><p><b>medication</b>: id: med0304; Myleran 2mg tablet, film coated <span>(Details : {http://hl7.org/fhir/sid/ndc code '76388-713-25' = 'n/a', given as 'Myleran 2mg tablet, film coated'})</span></p><p><b>subject</b>: <a>Donald Duck</a></p><p><b>effective</b>: 15/01/2015 10:03:00 PM --&gt; 16/01/2015 2:03:00 AM</p><h3>Performers</h3><table><tr><td>-</td><td><b>Actor</b></td></tr><tr><td>*</td><td><a>Patrick Pump</a></td></tr></table><p><b>request</b>: <a>MedicationRequest/medrx0306</a></p><h3>Dosages</h3><table><tr><td>-</td><td><b>Text</b></td><td><b>Route</b></td><td><b>Dose</b></td></tr><tr><td>*</td><td>6 mg PO daily for remission induction; adjust dosage to white blood cell (WBC) count.  With hold treatment if WBC is less than 15,000/µL; resume when WBC is greater than 50,000/µL</td><td>Oral route (qualifier value) <span>(Details : {SNOMED CT code '26643006' = 'Oral route', given as 'Oral route (qualifier value)'})</span></td><td>6 mg<span> (Details: UCUM code mg = 'mg')</span></td></tr></table></div>"
      },
      "contained": [
        {
          "resourceType": "Medication",
          "id": "med0304",
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/sid/ndc",
                "code": "76388-713-25",
                "display": "Myleran 2mg tablet, film coated"
              }
            ]
          }
        }
      ],
      "status": "completed",
      "medicationReference": {
        "reference": "#med0304"
      },
      "subject": {
        "reference": "Patient/" + patientId
      },
      "effectivePeriod": {
        "start": "2015-01-15T22:03:00+01:00",
        "end": "2015-01-16T02:03:00+01:00"
      },
      "dosage": {
        "text": "6 mg PO daily for remission induction; adjust dosage to white blood cell (WBC) count.  With hold treatment if WBC is less than 15,000/µL; resume when WBC is greater than 50,000/µL",
        "route": {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "26643006",
              "display": "Oral route (qualifier value)"
            }
          ]
        },
        "dose": {
          "value": 6,
          "unit": "mg",
          "system": "http://unitsofmeasure.org",
          "code": "mg"
        }
      }
        
    }
    • addMedicationDispense:
    {
      "resourceType": "MedicationDispense",
      "id": "meddisp008",
      "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: meddisp008</p><p><b>contained</b>: </p><p><b>status</b>: completed</p><p><b>medication</b>: id: medexample015; Capecitabine 500mg oral tablet (Xeloda) <span>(Details : {RxNorm code '213293' = 'Xeloda 500 MG Oral Tablet', given as 'Capecitabine 500mg oral tablet (Xeloda)'})</span></p><p><b>subject</b>: <a>Donald Duck</a></p><h3>Performers</h3><table><tr><td>-</td><td><b>Actor</b></td></tr><tr><td>*</td><td><a>Practitioner/f006</a></td></tr></table><p><b>authorizingPrescription</b>: <a>MedicationRequest/medrx0309</a></p><p><b>dosageInstruction</b>: </p></div>"
      },
      "contained": [
        {
          "resourceType": "Medication",
          "id": "medexample015",
          "code": {
            "coding": [
              {
                "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                "code": "213293",
                "display": "Capecitabine 500mg oral tablet (Xeloda)"
              }
            ]
          }
        }
      ],
      "status": "completed",
      "medicationReference": {
        "reference": "#medexample015"
      },
      "subject": {
        "reference": "Patient/" + patientId
            
      },
          
      "dosageInstruction": [
        {
          "sequence": 1,
          "timing": {
            "repeat": {
              "frequency": 2,
              "period": 21,
              "periodUnit": "d"
            }
          },
          "route": {
            "coding": [
              {
                "system": "http://snomed.info/sct",
                "code": "394899003",
                "display": "oral administration of treatment"
              }
            ]
          },
          "doseAndRate": [
            {
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/dose-rate-type",
                    "code": "ordered",
                    "display": "Ordered"
                  }
                ]
              },
              "doseQuantity": {
                "value": 500,
                "unit": "mg",
                "system": "http://unitsofmeasure.org",
                "code": "mg"
              }
            }
          ]
        }
      ]
    }

    -addMedicationRequest:

    {
        "resourceType": "MedicationRequest",
        "medicationRequestId": "39550",
        "meta": {
          "versionId": "1",
          "lastUpdated": "2019-10-03T08:23:16.555+00:00",
          "source": "#16603bb923676fa5"
        },
        "identifier": [
          {
            "type": {
              "coding": [
                {
                  "system": "http://hl7.org/fhir/v2/0203",
                  "code": "MR",
                  "display": "Medical record number"
                }
              ]
            },
            "value": "cdbd5b01-6cde-11db-9fe1-0800200c9a66"
          }
        ],
        "status": "active",
        "intent": "proposal",
        "medicationReference": {
          "reference": "Medication/39549"
        },
        "subject": {
          "reference": "Patient/39254"
        },
        "dosageInstruction": [
          {
            "route": {
              "coding": [
                {
                  "system": "http://snomed.info/sct",
                  "code": "6064005",
                  "display": "Topical route (qualifier value)"
                }
              ]
            },
            "doseAndRate": [
              {
                "doseQuantity": {
                  "value": 1
                }
              }
            ]
          }
        ]
      }
    • addMedicationStatement:
    {
      "resourceType": "MedicationStatement",
      "id": "example001",
      "text": {
        "status": "generated",
        "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative with Details</b></p><p><b>id</b>: example001</p><p><b>contained</b>: </p><p><b>identifier</b>: 12345689 (OFFICIAL)</p><p><b>status</b>: active</p><p><b>category</b>: Inpatient <span>(Details : {http://terminology.hl7.org/CodeSystem/medication-statement-category code 'inpatient' = 'Inpatient', given as 'Inpatient'})</span></p><p><b>medication</b>: id: med0309; Tylenol PM <span>(Details : {http://hl7.org/fhir/sid/ndc code '50580-506-02' = 'n/a', given as 'Tylenol PM'})</span>; Film-coated tablet (qualifier value) <span>(Details : {SNOMED CT code '385057009' = 'Film-coated tablet', given as 'Film-coated tablet (qualifier value)'})</span></p><p><b>subject</b>: <a>Donald Duck</a></p><p><b>effective</b>: 23/01/2015</p><p><b>dateAsserted</b>: 22/02/2015</p><p><b>informationSource</b>: <a>Donald Duck</a></p><p><b>derivedFrom</b>: <a>MedicationRequest/medrx002</a></p><p><b>reasonCode</b>: Restless Legs <span>(Details : {SNOMED CT code '32914008' = 'Restless legs', given as 'Restless Legs'})</span></p><p><b>note</b>: Patient indicates they miss the occasional dose</p><p><b>dosage</b>: </p></div>"
      },
      "contained": [
        {
          "resourceType": "Medication",
          "id": "med0309",
          "code": {
            "coding": [
              {
                "system": "http://hl7.org/fhir/sid/ndc",
                "code": "50580-506-02",
                "display": "Tylenol PM"
              }
            ]
          },
          "form": {
            "coding": [
              {
                "system": "http://snomed.info/sct",
                "code": "385057009",
                "display": "Film-coated tablet (qualifier value)"
              }
            ]
          },
          "ingredient": [
                
            {
              "itemCodeableConcept": {
                "coding": [
                  {
                    "system": "http://www.nlm.nih.gov/research/umls/rxnorm",
                    "code": "901813",
                    "display": "Diphenhydramine Hydrochloride 25 mg"
                  }
                ]
              }
            }
          ],
          "batch": {
            "lotNumber": "9494788",
            "expirationDate": "2017-05-22"
          }
        }
      ],
      "identifier": [
        {
          "use": "official",
          "system": "http://www.bmc.nl/portal/medstatements",
          "value": "12345689"
        }
      ],
      "status": "active",
      "category": {
        "coding": [
          {
            "system": "http://terminology.hl7.org/CodeSystem/medication-statement-category",
            "code": "inpatient",
            "display": "Inpatient"
          }
        ]
      },
      "medicationReference": {
        "reference": "#med0309"
      },
      "subject": {
        "reference": "Patient/" + patientId,
      },
      "effectiveDateTime": "2015-01-23",
      "dateAsserted": "2015-02-22",
      "informationSource": {
        "reference": "Patient/pat1",
        "display": "Donald Duck"
      },
      "reasonCode": [
        {
          "coding": [
            {
              "system": "http://snomed.info/sct",
              "code": "32914008",
              "display": "Restless Legs"
            }
          ]
        }
      ],
      "note": [
        {
          "text": "Patient indicates they miss the occasional dose"
        }
      ],
      "dosage": [
        {
          "sequence": 1,
          "text": "1-2 tablets once daily at bedtime as needed for restless legs",
          "additionalInstruction": [
            {
              "text": "Taking at bedtime"
            }
          ],
          "timing": {
            "repeat": {
              "frequency": 1,
              "period": 1,
              "periodUnit": "d"
            }
          },
          "asNeededCodeableConcept": {
            "coding": [
              {
                "system": "http://snomed.info/sct",
                "code": "32914008",
                "display": "Restless Legs"
              }
            ]
          },
          "route": {
            "coding": [
              {
                "system": "http://snomed.info/sct",
                "code": "26643006",
                "display": "Oral Route"
              }
            ]
          },
          "doseAndRate": [
            {
              "type": {
                "coding": [
                  {
                    "system": "http://terminology.hl7.org/CodeSystem/dose-rate-type",
                    "code": "ordered",
                    "display": "Ordered"
                  }
                ]
              },
              "doseRange": {
                "low": {
                  "value": 1,
                  "unit": "TAB",
                  "system": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm",
                  "code": "TAB"
                },
                "high": {
                  "value": 2,
                  "unit": "TAB",
                  "system": "http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm",
                  "code": "TAB"
                }
              }
            }
          ]
        }
      ]
    }
    • addDiagnosticReport:
    {
        resourceType: 'DiagnosticReport',
        diagnosticReportId: '70000',
        subject: {
            reference: 'Patient/' + patientId
        },
        issued: '2020-01-01T00:00:00',
        status: 'final',
        text: 'Urinalysis',
        code: {
            coding: [
                {
                    system: 'http://loinc.org',
                    code: '11502-2',
                    display: 'Urinalysis'
                }
            ]
        },
        effectiveDateTime: '2020-01-01T00:00:00'
    }

    Please note that these are just examples and you may need to adjust the values based on your specific use case.

List of Features

Please note: the data strictly follows the FHIR (Fast Healthcare Interoperability Resources) standard, with some adjustments allowed by BeGood admins.

  • addPatient
  • addAppointment:
  • addCondition
  • addProcedure
  • addObservation
  • addAllergyIntolerance
  • addImmunization
  • addMedicationRequest
  • addMedicationAdministration
  • addMedicationDispense
  • addMedicationStatement
  • addDiagnosticReport

Contributing

License