Skip to content

Instantly share code, notes, and snippets.

CREATE DEFINER=`etl_user`@`%` PROCEDURE `generate_flat_onc_htn_dm_triage_v1_0`(IN query_type VARCHAR(50), IN queue_number INT, IN queue_size INT, IN cycle_size INT)
BEGIN
SET @primary_table := "flat_onc_htn_dm_triage";
SET @query_type := query_type;
SET @total_rows_written := 0;
SET @encounter_types := "(130)";
SET @start := now();
@denniskigen
denniskigen / mappings
Created November 7, 2019 10:09
Column name to concept type mappings
cur_visit_type answer concept mapping
1 1911 New
2 1246 Scheduled visit
cancer_type answer concept mapping
1 6485 Sarcoma
2 6514 Genitourinary cancer
3 6520 Gastrointenstinal cancer
4 6528 Head and neck cancer
5 6536 Gynecologic cancer
@denniskigen
denniskigen / flat_onc_patient_history_v1_0.sql
Created December 10, 2019 11:49
Dump of the flat oncology patient history stored procedure
DELIMITER $$
CREATE DEFINER=`etl_user`@`%` PROCEDURE `generate_flat_onc_patient_history_v1_0`(IN query_type varchar(50), IN queue_number int, IN queue_size int, IN cycle_size int)
BEGIN
set @primary_table := "flat_onc_patient_history";
set @query_type = query_type;
set @total_rows_written = 0;
set @encounter_types = "(69,70,86,145,146,147,160,38,39,40,41,42,45,130,141,148,149,150,151,175,142,143,169,170,177,91,92,89,90,93,94,184)";
import React from "react";
import { match } from "react-router";
import SummaryCard from "../cards/summary-card.component";
import { fetchPatientMedications } from "./medications.resource";
import styles from "./medication-level-two.css";
import { formatDate } from "../heightandweight/heightandweight-helper";
import { createErrorHandler } from "@openmrs/esm-error-handling";
import { useCurrentPatient } from "@openmrs/esm-api";
import SummaryCardFooter from "../cards/summary-card-footer.component";
import { useTranslation } from "react-i18next";
{
"name": "component_oncology-lab-results-v1.0",
"uuid": "xxxx",
"processor": "EncounterFormProcessor",
"pages": [
{
"label": "Test Results",
"sections": [
{
"label": "Prior VIA",
import React, { useState, useEffect } from "react";
import { useCurrentPatient, newWorkspaceItem } from "@openmrs/esm-api";
import { useRouteMatch } from "react-router-dom";
import { performPatientsVitalsSearch } from "./vitals-card.resource";
import { createErrorHandler } from "@openmrs/esm-error-handling";
import styles from "./vital-record.css";
import SummaryCard from "../../ui-components/cards/summary-card.component";
// import VitalsForm from "./alt-vitals-form.component";
import VitalsForm from "./vitals-form.component";
import dayjs from "dayjs";
@denniskigen
denniskigen / Date of last VIA findings
Last active April 14, 2020 09:20
Snippet from the Oncology VIA form showing the `prior via result` question
{
"label": "Prior VIA result:",
"id": "priorviaresult",
"type": "obs",
"historicalExpression": "HD.getObject('prevEnc').getValue('f165c64a-9354-4145-9b06-4ee437630218')",
"questionOptions": {
"concept": "f165c64a-9354-4145-9b06-4ee437630218",
"rendering": "select",
"answers": [
{
function getDimensionsObservations(patientId: string) {
return openmrsObservableFetch(
`${fhirConfig.baseUrl}/Observation?subject:Patient=${patientId}&code=${WEIGHT_CONCEPT},${HEIGHT_CONCEPT}`
).pipe(
map(({ data }) => data["entry"]),
map(entries => {
if (entries) {
const dimensions = entries.map(entry => entry.resource);
return {
heights: dimensions.filter(dimension =>
CREATE DEFINER=`etl_user`@`%` PROCEDURE `generate_flat_lung_cancer_treatment_v1_0`(IN query_type varchar(50), IN queue_number int, IN queue_size int, IN cycle_size int)
BEGIN
SET @primary_table := "flat_lung_cancer_treatment";
SET @query_type := query_type;
SET @total_rows_written := 0;
SET @encounter_types := "(169,170)";
SET @clinical_encounter_types := "(-1)";
SET @non_clinical_encounter_types := "(-1)";
// en.json
{
"actions_upper": "ACTIONS",
"active": "Active",
"activeConditions": "Active Conditions",
"activeMedications_lower": "active medications",
"activeMedications_title": "Active Medications",
"activePrograms": "Active Programs",
"activePrograms_upper": "ACTIVE PROGRAMS",