diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f2cfffa22..d06d716b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,13 +30,10 @@ jobs: ruby-version: 2.7.2 bundler-cache: true - - name: Use Node.js 14.x + - name: Use Node.js 16.x uses: actions/setup-node@v2 with: - node-version: 14.x - - - name: Use latest npm - run: npm install -g npm + node-version: 16.x - name: Install bundler & bundle-audit run: | @@ -91,13 +88,10 @@ jobs: ruby-version: 2.7.2 bundler-cache: true - - name: Use Node.js 14.x + - name: Use Node.js 16.x uses: actions/setup-node@v2 with: - node-version: 14.x - - - name: Use latest npm - run: npm install -g npm + node-version: 16.x - name: Install bundler & bundle-audit run: | diff --git a/Dockerfile b/Dockerfile index dbedccb76..4013a65f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN bash -lc "rvm install ruby-${RUBY_VERSION} && rvm --default use ruby-${RUBY_ RUN rm -f /etc/service/nginx/down \ && rm -f /etc/nginx/sites-enabled/default \ && apt update \ - && curl -fsSL https://deb.nodesource.com/setup_14.x | bash - \ + && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ && apt-get install -y nodejs \ && npm install -g npm@latest \ && apt-get install shared-mime-info -y diff --git a/Gemfile.lock b/Gemfile.lock index ef242fcae..7afbe7e0f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/projecttacoma/cqm-parsers.git - revision: baa3e9a50b376e29a47956f5cfb7c5ebe49fc9dd + revision: 50891071760b46b70d120e5f3cc752c258cf2c69 branch: bonnie-prior-version specs: cqm-parsers (0.2.1.1) diff --git a/app/controllers/api_v1/measures_controller.rb b/app/controllers/api_v1/measures_controller.rb index 9bcfc3611..21e120ace 100644 --- a/app/controllers/api_v1/measures_controller.rb +++ b/app/controllers/api_v1/measures_controller.rb @@ -81,8 +81,7 @@ def description param :population_titles, Array, of: String, :required => false, :desc => "The titles of the populations. If this is not included, populations will assume default values. i.e. \"Population 1\", \"Population 2\", etc." param :calculate_sdes, %w[true false], :required => false, :desc => "Should Supplemental Data Elements be included in calculations. Defaults to 'false' if not supplied." - param :vsac_tgt, String, :required => true, :desc => "VSAC ticket granting ticket. See https://www.nlm.nih.gov/vsac/support/" - param :vsac_tgt_expires_at, Integer, :required => true, :desc => "VSAC ticket granting ticket expiration time in seconds since epoch." + param :vsac_api_key, String, :required => true, :desc => "UMLS Api Key." param :vsac_query_type, %w[release profile], :required => false, :desc => "The type of VSAC query, either 'release', or 'profile'. Default to 'profile' if not supplied." param :vsac_query_include_draft, %w[true false], :required => false, :desc => "If VSAC should fetch draft value sets. Defaults to 'true' if not supplied." param :vsac_query_release, String, :required => false, :desc => "The program release used to retrieve value sets. Defaults to latest release for the eCQM program." @@ -210,7 +209,7 @@ def calculated_results formats ["multipart/form-data"] error :code => 400, :desc => "Client sent bad parameters. Response contains explanation." error :code => 409, :desc => "Measure with this HQMF Set ID already exists." - error :code => 500, :desc => "A server error occured." + error :code => 500, :desc => "A server error occurred." param_group :measure_upload def create permitted_params = params.permit!.to_h @@ -229,7 +228,7 @@ def create formats ["multipart/form-data"] error :code => 400, :desc => "Client sent bad parameters. Response contains explanation." error :code => 404, :desc => "Measure with this HQMF Set ID does not exist." - error :code => 500, :desc => "A server error occured." + error :code => 500, :desc => "A server error occurred." param_group :measure_upload def update measures, main_hqmf_set_id = update_measure(uploaded_file: params[:measure_file], diff --git a/app/controllers/measures_controller.rb b/app/controllers/measures_controller.rb index 4b56f11d9..4ee920ddc 100644 --- a/app/controllers/measures_controller.rb +++ b/app/controllers/measures_controller.rb @@ -31,7 +31,7 @@ def create begin scan_for_viruses(params[:measure_file]) - vsac_tgt = obtain_ticket_granting_ticket + set_vsac_api_key rescue VirusFoundError => e logger.error "VIRSCAN: error message: #{e.message}" raise MeasurePackageVirusFoundError.new @@ -43,13 +43,11 @@ def create raise convert_vsac_error_into_shared_error(e) end - params[:vsac_tgt] = vsac_tgt[:ticket] - params[:vsac_tgt_expires_at] = vsac_tgt[:expires] measures, main_hqmf_set_id = persist_measure(params[:measure_file], params.permit!.to_h, current_user) redirect_to "#{root_path}##{params[:redirect_route]}" rescue StandardError => e - # also clear the ticket granting ticket in the session if it was a VSACTicketExpiredError - session[:vsac_tgt] = nil if e.is_a?(VSACTicketExpiredError) + # also clear the vsac api key in the session if it was a VSACInvalidCredentialsError + session[:vsac_api_key] = nil if e.is_a?(VSACInvalidCredentialsError) flash[:error] = turn_exception_into_shared_error_if_needed(e).front_end_version redirect_to "#{root_path}##{params[:redirect_route]}" end @@ -162,6 +160,15 @@ def retrieve_measure_details(params) } end + def set_vsac_api_key + if session[:vsac_api_key].nil? + raise Util::VSAC::VSACNoCredentialsError.new if params[:vsac_api_key].nil? + session[:vsac_api_key] = params[:vsac_api_key] + else + params[:vsac_api_key] = session[:vsac_api_key] + end + end + def shift_years(measure, year_shift) # Copy the patients to make sure there are no errors before saving every patient patients = CQM::Patient.by_user_and_hqmf_set_id(current_user, measure.hqmf_set_id).all.entries @@ -202,33 +209,4 @@ def shift_birth_datetime(birth_datetime, year_shift) birth_datetime.change(year: year_shift + birth_datetime.year) end end - - def obtain_ticket_granting_ticket - # Retreive a (possibly) existing ticket granting ticket - ticket_granting_ticket = session[:vsac_tgt] - - # If the ticket granting ticket doesn't exist (or has expired), get a new one - if ticket_granting_ticket.nil? - # The user could open a second browser window and remove their ticket_granting_ticket in the session after they - # prepared a measure upload assuming ticket_granting_ticket in the session in the first tab - - # First make sure we have credentials to attempt getting a ticket with. Throw an error if there are no credentials. - if params[:vsac_api_key].nil? - raise Util::VSAC::VSACNoCredentialsError.new - end - - # Retrieve a new ticket granting ticket by creating the api class. - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: params[:vsac_api_key]) - ticket_granting_ticket = api.ticket_granting_ticket - - # Create a new ticket granting ticket session variable - session[:vsac_tgt] = ticket_granting_ticket - return ticket_granting_ticket - - # If it does exist, let the api test it - else - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], ticket_granting_ticket: ticket_granting_ticket) - return api.ticket_granting_ticket - end - end end diff --git a/app/controllers/vsac_util_controller.rb b/app/controllers/vsac_util_controller.rb index 32c439f51..25c995fb2 100644 --- a/app/controllers/vsac_util_controller.rb +++ b/app/controllers/vsac_util_controller.rb @@ -51,26 +51,20 @@ def program_release_names ## # GET /vsac_util/auth_valid # - # Gets the status of the ticket_granting_ticket in the session. Returns JSON: - # { valid: boolean, expires: DateTime } + # Gets the status of the API KEY in the session. Returns JSON: + # { valid: boolean } def auth_valid - # If VSAC TGT is still valid, return its expiration date/time - ticket_granting_ticket = session[:vsac_tgt] + vsac_api_key = session[:vsac_api_key] - # If there is no VSAC ticket granting ticket then return false. - if ticket_granting_ticket.nil? || ticket_granting_ticket.empty? - session[:vsac_tgt] = nil - render :json => {valid: false} - - # If it exists then check it using the API + if vsac_api_key.nil? || vsac_api_key.empty? + session[:vsac_api_key] = nil + render :json => {valid:false} else begin - Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], ticket_granting_ticket: ticket_granting_ticket) - render :json => {valid: true, expires: ticket_granting_ticket[:expires]} - - # API will throw an error if it has expired - rescue Util::VSAC::VSACTicketExpiredError - session[:vsac_tgt] = nil + # Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: vsac_api_key) + render :json => {valid: true} + rescue Util::VSAC::VSACInvalidCredentialsError + session[:vsac_api_key] = nil render :json => {valid: false} end end @@ -79,10 +73,10 @@ def auth_valid ## # POST /vsac_util/auth_expire # - # Dumps the ticket_granting_ticket in the user session if there is one. Always returns JSON {}. + # Sets the vsac_api_key in the user session to nil. Always returns JSON {}. def auth_expire # Force expire the VSAC session - session[:vsac_tgt] = nil + session[:vsac_api_key] = nil render :json => {} end end diff --git a/app/helpers/measure_helper.rb b/app/helpers/measure_helper.rb index e9a863b88..5180abb1d 100644 --- a/app/helpers/measure_helper.rb +++ b/app/helpers/measure_helper.rb @@ -256,11 +256,9 @@ def retrieve_vasc_options(params, get_defaults_from_vsac = false) end def build_vs_loader(params, get_defaults_from_vsac) - vsac_tgt_object = {ticket: params[:vsac_tgt], expires: Time.at(params[:vsac_tgt_expires_at].to_i)} if params[:vsac_tgt].present? && params[:vsac_tgt_expires_at].present? - - return Measures::VSACValueSetLoader.new( + Measures::VSACValueSetLoader.new( options: retrieve_vasc_options(params, get_defaults_from_vsac), - ticket_granting_ticket: vsac_tgt_object + vsac_api_key: params[:vsac_api_key] ) end @@ -270,8 +268,6 @@ def convert_vsac_error_into_shared_error(error) return VSACVSLoadingError.new(error.oid) elsif error.is_a?(Util::VSAC::VSACInvalidCredentialsError) return VSACInvalidCredentialsError.new - elsif error.is_a?(Util::VSAC::VSACTicketExpiredError) - return VSACTicketExpiredError.new elsif error.is_a?(Util::VSAC::VSACNoCredentialsError) return VSACNoCredentialsError.new else diff --git a/doc/apipie_examples.json b/doc/apipie_examples.json index b0bda4611..5647b2e48 100644 --- a/doc/apipie_examples.json +++ b/doc/apipie_examples.json @@ -335,7 +335,7 @@ "vsac_query_include_draft": "false", "vsac_query_measure_defined": "true", "vsac_api_key": "vcrpass", - "measure_file": "", + "measure_file": "", "measure_type": "ep", "calculation_type": "patient" }, @@ -343,6 +343,33430 @@ "code": "302", "show_in_doc": 1, "recorded": true + }, + { + "verb": "POST", + "path": "/measures", + "versions": [ + + ], + "query": null, + "request_data": { + "vsac_query_type": "profile", + "vsac_query_profile": "Latest eCQM", + "vsac_query_include_draft": "false", + "vsac_query_measure_defined": "true", + "vsac_api_key": "vcrpass", + "measure_file": "", + "measure_type": "ep", + "calculation_type": "patient" + }, + "response_data": "You are being redirected.", + "code": "302", + "show_in_doc": 1, + "recorded": true + } + ], + "measures#destroy": [ + { + "verb": "DELETE", + "path": "/measures", + "versions": [ + + ], + "query": null, + "request_data": { + }, + "response_data": { + "_id": "6500d365e77bbf53b55d218a", + "calculate_sdes": null, + "calculation_method": "PATIENT", + "cms_id": "CMS134v8", + "component": false, + "component_hqmf_set_ids": [ + + ], + "composite": false, + "composite_hqmf_set_id": null, + "cql_libraries": [ + { + "_id": "6500d365e77bbf53b55d218b", + "cql": "library Adult_Outpatient_Encounters version '1.2.000'\n\nusing QDM version '5.4'\n\nvalueset \"Annual Wellness Visit\": 'urn:oid:2.16.840.1.113883.3.526.3.1240' \nvalueset \"Home Healthcare Services\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1016' \nvalueset \"Office Visit\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1001' \nvalueset \"Preventive Care Services - Established Office Visit, 18 and Up\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1025' \nvalueset \"Preventive Care Services-Initial Office Visit, 18 and Up\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1023' \n\nparameter \"Measurement Period\" Interval\n\ncontext Patient\n\ndefine \"Qualifying Encounters\":\n\t( [\"Encounter, Performed\": \"Office Visit\"]\n\t\tunion [\"Encounter, Performed\": \"Annual Wellness Visit\"]\n\t\tunion [\"Encounter, Performed\": \"Preventive Care Services - Established Office Visit, 18 and Up\"]\n\t\tunion [\"Encounter, Performed\": \"Preventive Care Services-Initial Office Visit, 18 and Up\"]\n\t\tunion [\"Encounter, Performed\": \"Home Healthcare Services\"] ) ValidEncounter\n\t\twhere ValidEncounter.relevantPeriod during \"Measurement Period\"\n\n", + "elm": { + "library": { + "identifier": { + "id": "Adult_Outpatient_Encounters", + "version": "1.2.000" + }, + "schemaIdentifier": { + "id": "urn:hl7-org:elm", + "version": "r1" + }, + "usings": { + "def": [ + { + "localIdentifier": "System", + "uri": "urn:hl7-org:elm-types:r1" + }, + { + "localId": "1", + "locator": "3:1-3:23", + "localIdentifier": "QDM", + "uri": "urn:healthit-gov:qdm:v5_4", + "version": "5.4" + } + ] + }, + "parameters": { + "def": [ + { + "localId": "9", + "locator": "11:1-11:49", + "name": "Measurement Period", + "accessLevel": "Public", + "parameterTypeSpecifier": { + "localId": "8", + "locator": "11:32-11:49", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "7", + "locator": "11:41-11:48", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + ] + }, + "valueSets": { + "def": [ + { + "localId": "2", + "locator": "5:1-5:74", + "name": "Annual Wellness Visit", + "id": "2.16.840.1.113883.3.526.3.1240", + "accessLevel": "Public" + }, + { + "localId": "3", + "locator": "6:1-6:87", + "name": "Home Healthcare Services", + "id": "2.16.840.1.113883.3.464.1003.101.12.1016", + "accessLevel": "Public" + }, + { + "localId": "4", + "locator": "7:1-7:75", + "name": "Office Visit", + "id": "2.16.840.1.113883.3.464.1003.101.12.1001", + "accessLevel": "Public" + }, + { + "localId": "5", + "locator": "8:1-8:125", + "name": "Preventive Care Services - Established Office Visit, 18 and Up", + "id": "2.16.840.1.113883.3.464.1003.101.12.1025", + "accessLevel": "Public" + }, + { + "localId": "6", + "locator": "9:1-9:119", + "name": "Preventive Care Services-Initial Office Visit, 18 and Up", + "id": "2.16.840.1.113883.3.464.1003.101.12.1023", + "accessLevel": "Public" + } + ] + }, + "statements": { + "def": [ + { + "locator": "13:1-13:15", + "name": "Patient", + "context": "Patient", + "expression": { + "type": "SingletonFrom", + "operand": { + "locator": "13:1-13:15", + "dataType": "{urn:healthit-gov:qdm:v5_4}Patient", + "templateId": "Patient", + "type": "Retrieve" + } + } + }, + { + "localId": "25", + "locator": "15:1-21:65", + "name": "Qualifying Encounters", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "25", + "s": [ + { + "value": [ + "define ", + "\"Qualifying Encounters\"", + ":\n\t" + ] + }, + { + "r": "24", + "s": [ + { + "s": [ + { + "r": "19", + "s": [ + { + "r": "18", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "18", + "s": [ + { + "r": "16", + "s": [ + { + "r": "14", + "s": [ + { + "r": "12", + "s": [ + { + "r": "10", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Office Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "11", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Annual Wellness Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "13", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Preventive Care Services - Established Office Visit, 18 and Up\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "15", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Preventive Care Services-Initial Office Visit, 18 and Up\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "17", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Home Healthcare Services\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + " ", + "ValidEncounter" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "23", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "23", + "s": [ + { + "r": "21", + "s": [ + { + "r": "20", + "s": [ + { + "value": [ + "ValidEncounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "21", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "during", + " " + ] + }, + { + "r": "22", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "24", + "locator": "16:2-21:65", + "type": "Query", + "source": [ + { + "localId": "19", + "locator": "16:2-20:77", + "alias": "ValidEncounter", + "expression": { + "localId": "18", + "locator": "16:2-20:62", + "type": "Union", + "operand": [ + { + "localId": "16", + "locator": "16:4-19:92", + "type": "Union", + "operand": [ + { + "localId": "12", + "locator": "16:4-17:57", + "type": "Union", + "operand": [ + { + "localId": "10", + "locator": "16:4-16:43", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Office Visit", + "type": "ValueSetRef" + } + }, + { + "localId": "11", + "locator": "17:9-17:57", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Annual Wellness Visit", + "type": "ValueSetRef" + } + } + ] + }, + { + "type": "Union", + "operand": [ + { + "localId": "13", + "locator": "18:9-18:98", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Preventive Care Services - Established Office Visit, 18 and Up", + "type": "ValueSetRef" + } + }, + { + "localId": "15", + "locator": "19:9-19:92", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Preventive Care Services-Initial Office Visit, 18 and Up", + "type": "ValueSetRef" + } + } + ] + } + ] + }, + { + "localId": "17", + "locator": "20:9-20:60", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Home Healthcare Services", + "type": "ValueSetRef" + } + } + ] + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "23", + "locator": "21:3-21:65", + "type": "IncludedIn", + "operand": [ + { + "localId": "21", + "locator": "21:9-21:37", + "path": "relevantPeriod", + "scope": "ValidEncounter", + "type": "Property" + }, + { + "localId": "22", + "locator": "21:46-21:65", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + } + } + }, + "elm_annotations": { + "statements": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Qualifying Encounters\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Office Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "10" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Annual Wellness Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "11" + } + ], + "node_type": "Union", + "ref_id": "12" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Preventive Care Services - Established Office Visit, 18 and Up\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "13" + } + ], + "ref_id": "14" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Preventive Care Services-Initial Office Visit, 18 and Up\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "15" + } + ], + "node_type": "Union", + "ref_id": "16" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Home Healthcare Services\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "17" + } + ], + "node_type": "Union", + "ref_id": "18" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "Union", + "ref_id": "18" + }, + { + "children": [ + { + "text": " ValidEncounter" + } + ] + } + ], + "ref_id": "19" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "ValidEncounter" + } + ] + } + ], + "ref_id": "20" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "21" + } + ], + "node_type": "Property", + "ref_id": "21" + }, + { + "children": [ + { + "text": " during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "22" + } + ], + "ref_id": "23" + } + ], + "ref_id": "23" + } + ], + "node_type": "Query", + "ref_id": "24" + } + ], + "ref_id": "25" + } + ], + "define_name": "Qualifying Encounters" + } + ], + "identifier": { + "id": "Adult_Outpatient_Encounters", + "version": "1.2.000" + } + }, + "is_main_library": false, + "is_top_level": true, + "library_name": "Adult_Outpatient_Encounters", + "library_version": "1.2.000", + "statement_dependencies": [ + { + "_id": "6500d365e77bbf53b55d218c", + "statement_name": "Qualifying Encounters" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d218d", + "cql": "library AdvancedIllnessandFrailtyExclusionECQM version '4.0.000'\n\nusing QDM version '5.4'\n\ninclude MATGlobalCommonFunctions version '4.0.000' called Global\n\ncodesystem \"LOINC\": 'urn:oid:2.16.840.1.113883.6.1' \n\nvalueset \"Acute Inpatient\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1083' \nvalueset \"Advanced Illness\": 'urn:oid:2.16.840.1.113883.3.464.1003.110.12.1082' \nvalueset \"Care Services in Long-Term Residential Facility\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1014' \nvalueset \"Dementia Medications\": 'urn:oid:2.16.840.1.113883.3.464.1003.196.12.1510' \nvalueset \"ED\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1085' \nvalueset \"Frailty Device\": 'urn:oid:2.16.840.1.113883.3.464.1003.118.12.1300' \nvalueset \"Frailty Diagnosis\": 'urn:oid:2.16.840.1.113883.3.464.1003.113.12.1074' \nvalueset \"Frailty Encounter\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1088' \nvalueset \"Frailty Symptom\": 'urn:oid:2.16.840.1.113883.3.464.1003.113.12.1075' \nvalueset \"Nonacute Inpatient\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1084' \nvalueset \"Nursing Facility Visit\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1012' \nvalueset \"Observation\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1086' \nvalueset \"Outpatient\": 'urn:oid:2.16.840.1.113883.3.464.1003.101.12.1087' \n\ncode \"Birth date\": '21112-8' from \"LOINC\" display 'Birth date'\n\nparameter \"Measurement Period\" Interval\n\ncontext Patient\n\ndefine \"Outpatient Encounters with Advanced Illness\":\n\t( [\"Encounter, Performed\": \"Outpatient\"]\n\t\tunion [\"Encounter, Performed\": \"Observation\"]\n\t\tunion [\"Encounter, Performed\": \"ED\"]\n\t\tunion [\"Encounter, Performed\": \"Nonacute Inpatient\"] ) OutpatientEncounter\n\t\twhere exists ( OutpatientEncounter.diagnoses Diagnosis\n\t\t\t\twhere Diagnosis in \"Advanced Illness\"\n\t\t)\n\t\t\tand OutpatientEncounter.relevantPeriod starts 2 years or less before \n\t\t\tend of \"Measurement Period\"\n\ndefine \"Long Term Care Periods During Measurement Period\":\n\t( [\"Encounter, Performed\": \"Care Services in Long-Term Residential Facility\"]\n\t\tunion [\"Encounter, Performed\": \"Nursing Facility Visit\"] ) LongTermFacilityEncounter\n\t\twhere LongTermFacilityEncounter.relevantPeriod overlaps \"Measurement Period\"\n\t\treturn LongTermFacilityEncounter.relevantPeriod\n\t\t\tintersect \"Measurement Period\"\n\ndefine \"Inpatient Encounter with Advanced Illness\":\n\t[\"Encounter, Performed\": \"Acute Inpatient\"] InpatientEncounter\n\t\twhere exists ( InpatientEncounter.diagnoses Diagnosis\n\t\t\t\twhere Diagnosis in \"Advanced Illness\"\n\t\t)\n\t\t\tand InpatientEncounter.relevantPeriod starts 2 years or less before \n\t\t\tend of \"Measurement Period\"\n\ndefine \"Dementia Medications In Year Before or During Measurement Period\":\n\t[\"Medication, Active\": \"Dementia Medications\"] DementiaMed\n\t\twhere DementiaMed.relevantPeriod overlaps Interval[( start of \"Measurement Period\" - 1 year ), \n\t\tend of \"Measurement Period\"]\n\ndefine \"Has Criteria Indicating Frailty\":\n\texists ( [\"Device, Order\": \"Frailty Device\"] FrailtyDeviceOrder\n\t\t\twhere FrailtyDeviceOrder.authorDatetime during \"Measurement Period\"\n\t)\n\t\tor exists ( [\"Device, Applied\": \"Frailty Device\"] FrailtyDeviceApplied\n\t\t\t\twhere FrailtyDeviceApplied.relevantPeriod overlaps \"Measurement Period\"\n\t\t)\n\t\tor exists ( [\"Diagnosis\": \"Frailty Diagnosis\"] FrailtyDiagnosis\n\t\t\t\twhere FrailtyDiagnosis.prevalencePeriod overlaps \"Measurement Period\"\n\t\t)\n\t\tor exists ( [\"Encounter, Performed\": \"Frailty Encounter\"] FrailtyEncounter\n\t\t\t\twhere FrailtyEncounter.relevantPeriod overlaps \"Measurement Period\"\n\t\t)\n\t\tor exists ( [\"Symptom\": \"Frailty Symptom\"] FrailtySymptom\n\t\t\t\twhere FrailtySymptom.prevalencePeriod overlaps \"Measurement Period\"\n\t\t)\n\ndefine \"Advanced Illness and Frailty Exclusion Including Over Age 80\":\n\t//If the measure includes populations age 80 and older, then use this logic:\n\texists ( [\"Patient Characteristic Birthdate\": \"Birth date\"] BirthDate\n\t\t\twhere ( Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")in Interval[66, 80])\n\t\t\t\tand \"Has Criteria Indicating Frailty\"\n\t\t\t\tand ( Count(\"Outpatient Encounters with Advanced Illness\")>= 2\n\t\t\t\t\t\tor exists ( \"Inpatient Encounter with Advanced Illness\" )\n\t\t\t\t\t\tor exists \"Dementia Medications In Year Before or During Measurement Period\"\n\t\t\t\t)\n\t)\n\t\tor exists ( [\"Patient Characteristic Birthdate\": \"Birth date\"] BirthDate\n\t\t\t\twhere ( Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")>= 81 )\n\t\t\t\t\tand \"Has Criteria Indicating Frailty\"\n\t\t)\n\ndefine \"Advanced Illness and Frailty Exclusion Including Under Age 80\":\n\t//If the measure does NOT include populations age 80 and older, then use this logic:\n\texists ( [\"Patient Characteristic Birthdate\": \"Birth date\"] BirthDate\n\t\t\twhere Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")>= 65\n\t\t\t\tand \"Has Criteria Indicating Frailty\"\n\t\t\t\tand ( Count(\"Outpatient Encounters with Advanced Illness\")>= 2\n\t\t\t\t\t\tor exists ( \"Inpatient Encounter with Advanced Illness\" )\n\t\t\t\t\t\tor exists \"Dementia Medications In Year Before or During Measurement Period\"\n\t\t\t\t)\n\t)\n\ndefine \"Has Spent More Than 90 Days in Long Term Care\":\n\t\"Days Spent in Long Term Care During Measurement Period\" > 90\n\ndefine \"Days Spent in Long Term Care During Measurement Period\":\n\t\"CumulativeDays\"(\"Long Term Care Periods During Measurement Period\")\n\ndefine function \"CumulativeDays\"(Intervals List> ):\n\tSum((collapse Intervals)CollapsedInterval\n\t\t\treturn all duration in days of CollapsedInterval\n\t)\n\n", + "elm": { + "library": { + "identifier": { + "id": "AdvancedIllnessandFrailtyExclusionECQM", + "version": "4.0.000" + }, + "schemaIdentifier": { + "id": "urn:hl7-org:elm", + "version": "r1" + }, + "usings": { + "def": [ + { + "localIdentifier": "System", + "uri": "urn:hl7-org:elm-types:r1" + }, + { + "localId": "1", + "locator": "3:1-3:23", + "localIdentifier": "QDM", + "uri": "urn:healthit-gov:qdm:v5_4", + "version": "5.4" + } + ] + }, + "includes": { + "def": [ + { + "localId": "2", + "locator": "5:1-5:64", + "localIdentifier": "Global", + "path": "MATGlobalCommonFunctions", + "version": "4.0.000" + } + ] + }, + "parameters": { + "def": [ + { + "localId": "21", + "locator": "25:1-25:49", + "name": "Measurement Period", + "accessLevel": "Public", + "parameterTypeSpecifier": { + "localId": "20", + "locator": "25:32-25:49", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "19", + "locator": "25:41-25:48", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + ] + }, + "codeSystems": { + "def": [ + { + "localId": "3", + "locator": "7:1-7:51", + "name": "LOINC", + "id": "2.16.840.1.113883.6.1", + "accessLevel": "Public" + } + ] + }, + "valueSets": { + "def": [ + { + "localId": "4", + "locator": "9:1-9:78", + "name": "Acute Inpatient", + "id": "2.16.840.1.113883.3.464.1003.101.12.1083", + "accessLevel": "Public" + }, + { + "localId": "5", + "locator": "10:1-10:79", + "name": "Advanced Illness", + "id": "2.16.840.1.113883.3.464.1003.110.12.1082", + "accessLevel": "Public" + }, + { + "localId": "6", + "locator": "11:1-11:110", + "name": "Care Services in Long-Term Residential Facility", + "id": "2.16.840.1.113883.3.464.1003.101.12.1014", + "accessLevel": "Public" + }, + { + "localId": "7", + "locator": "12:1-12:83", + "name": "Dementia Medications", + "id": "2.16.840.1.113883.3.464.1003.196.12.1510", + "accessLevel": "Public" + }, + { + "localId": "8", + "locator": "13:1-13:65", + "name": "ED", + "id": "2.16.840.1.113883.3.464.1003.101.12.1085", + "accessLevel": "Public" + }, + { + "localId": "9", + "locator": "14:1-14:77", + "name": "Frailty Device", + "id": "2.16.840.1.113883.3.464.1003.118.12.1300", + "accessLevel": "Public" + }, + { + "localId": "10", + "locator": "15:1-15:80", + "name": "Frailty Diagnosis", + "id": "2.16.840.1.113883.3.464.1003.113.12.1074", + "accessLevel": "Public" + }, + { + "localId": "11", + "locator": "16:1-16:80", + "name": "Frailty Encounter", + "id": "2.16.840.1.113883.3.464.1003.101.12.1088", + "accessLevel": "Public" + }, + { + "localId": "12", + "locator": "17:1-17:78", + "name": "Frailty Symptom", + "id": "2.16.840.1.113883.3.464.1003.113.12.1075", + "accessLevel": "Public" + }, + { + "localId": "13", + "locator": "18:1-18:81", + "name": "Nonacute Inpatient", + "id": "2.16.840.1.113883.3.464.1003.101.12.1084", + "accessLevel": "Public" + }, + { + "localId": "14", + "locator": "19:1-19:85", + "name": "Nursing Facility Visit", + "id": "2.16.840.1.113883.3.464.1003.101.12.1012", + "accessLevel": "Public" + }, + { + "localId": "15", + "locator": "20:1-20:74", + "name": "Observation", + "id": "2.16.840.1.113883.3.464.1003.101.12.1086", + "accessLevel": "Public" + }, + { + "localId": "16", + "locator": "21:1-21:73", + "name": "Outpatient", + "id": "2.16.840.1.113883.3.464.1003.101.12.1087", + "accessLevel": "Public" + } + ] + }, + "codes": { + "def": [ + { + "localId": "18", + "locator": "23:1-23:62", + "name": "Birth date", + "id": "21112-8", + "display": "Birth date", + "accessLevel": "Public", + "codeSystem": { + "localId": "17", + "locator": "23:35-23:41", + "name": "LOINC" + } + } + ] + }, + "statements": { + "def": [ + { + "locator": "27:1-27:15", + "name": "Patient", + "context": "Patient", + "expression": { + "type": "SingletonFrom", + "operand": { + "locator": "27:1-27:15", + "dataType": "{urn:healthit-gov:qdm:v5_4}Patient", + "templateId": "Patient", + "type": "Retrieve" + } + } + }, + { + "localId": "45", + "locator": "29:1-38:30", + "name": "Outpatient Encounters with Advanced Illness", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "45", + "s": [ + { + "value": [ + "define ", + "\"Outpatient Encounters with Advanced Illness\"", + ":\n\t" + ] + }, + { + "r": "44", + "s": [ + { + "s": [ + { + "r": "29", + "s": [ + { + "r": "28", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "28", + "s": [ + { + "r": "26", + "s": [ + { + "r": "24", + "s": [ + { + "r": "22", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Outpatient\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "23", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Observation\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "25", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"ED\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "27", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Nonacute Inpatient\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + " ", + "OutpatientEncounter" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "43", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "43", + "s": [ + { + "r": "36", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "35", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "35", + "s": [ + { + "s": [ + { + "r": "31", + "s": [ + { + "r": "30", + "s": [ + { + "s": [ + { + "value": [ + "OutpatientEncounter", + ".", + "diagnoses" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Diagnosis" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "34", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "34", + "s": [ + { + "r": "32", + "s": [ + { + "value": [ + "Diagnosis" + ] + } + ] + }, + { + "value": [ + " in " + ] + }, + { + "r": "33", + "s": [ + { + "value": [ + "\"Advanced Illness\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\tand " + ] + }, + { + "r": "42", + "s": [ + { + "r": "38", + "s": [ + { + "r": "37", + "s": [ + { + "value": [ + "OutpatientEncounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "38", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "42", + "s": [ + { + "value": [ + "starts " + ] + }, + { + "r": "41", + "s": [ + { + "value": [ + "2 ", + "years" + ] + } + ] + }, + { + "value": [ + " or less before" + ] + } + ] + }, + { + "value": [ + " \n\t\t\t" + ] + }, + { + "r": "40", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "39", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "44", + "locator": "30:2-38:30", + "type": "Query", + "source": [ + { + "localId": "29", + "locator": "30:2-33:76", + "alias": "OutpatientEncounter", + "expression": { + "localId": "28", + "locator": "30:2-33:56", + "type": "Union", + "operand": [ + { + "localId": "24", + "locator": "30:4-31:47", + "type": "Union", + "operand": [ + { + "localId": "22", + "locator": "30:4-30:41", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Outpatient", + "type": "ValueSetRef" + } + }, + { + "localId": "23", + "locator": "31:9-31:47", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Observation", + "type": "ValueSetRef" + } + } + ] + }, + { + "type": "Union", + "operand": [ + { + "localId": "25", + "locator": "32:9-32:38", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "ED", + "type": "ValueSetRef" + } + }, + { + "localId": "27", + "locator": "33:9-33:54", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Nonacute Inpatient", + "type": "ValueSetRef" + } + } + ] + } + ] + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "43", + "locator": "34:3-38:30", + "type": "And", + "operand": [ + { + "localId": "36", + "locator": "34:9-36:3", + "type": "Exists", + "operand": { + "localId": "35", + "locator": "34:16-36:3", + "type": "Query", + "source": [ + { + "localId": "31", + "locator": "34:18-34:56", + "alias": "Diagnosis", + "expression": { + "localId": "30", + "locator": "34:18-34:46", + "path": "diagnoses", + "scope": "OutpatientEncounter", + "type": "Property" + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "34", + "locator": "35:5-35:41", + "type": "InValueSet", + "code": { + "localId": "32", + "locator": "35:11-35:19", + "name": "Diagnosis", + "type": "AliasRef" + }, + "valueset": { + "localId": "33", + "locator": "35:24-35:41", + "name": "Advanced Illness" + } + } + } + }, + { + "localId": "42", + "locator": "37:8-38:30", + "type": "In", + "operand": [ + { + "locator": "37:43-37:48", + "type": "Start", + "operand": { + "localId": "38", + "locator": "37:8-37:41", + "path": "relevantPeriod", + "scope": "OutpatientEncounter", + "type": "Property" + } + }, + { + "locator": "37:50-37:64", + "lowClosed": true, + "highClosed": false, + "type": "Interval", + "low": { + "locator": "38:4-38:30", + "type": "Subtract", + "operand": [ + { + "localId": "40", + "locator": "38:4-38:30", + "type": "End", + "operand": { + "localId": "39", + "locator": "38:11-38:30", + "name": "Measurement Period", + "type": "ParameterRef" + } + }, + { + "localId": "41", + "locator": "37:50-37:56", + "value": 2, + "unit": "years", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "40", + "locator": "38:4-38:30", + "type": "End", + "operand": { + "localId": "39", + "locator": "38:11-38:30", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + } + ] + } + ] + } + } + }, + { + "localId": "60", + "locator": "40:1-45:33", + "name": "Long Term Care Periods During Measurement Period", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "60", + "s": [ + { + "value": [ + "define ", + "\"Long Term Care Periods During Measurement Period\"", + ":\n\t" + ] + }, + { + "r": "59", + "s": [ + { + "s": [ + { + "r": "49", + "s": [ + { + "r": "48", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "48", + "s": [ + { + "r": "46", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Care Services in Long-Term Residential Facility\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "47", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Nursing Facility Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + " ", + "LongTermFacilityEncounter" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "53", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "53", + "s": [ + { + "r": "51", + "s": [ + { + "r": "50", + "s": [ + { + "value": [ + "LongTermFacilityEncounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "51", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "52", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "58", + "s": [ + { + "value": [ + "return " + ] + }, + { + "r": "57", + "s": [ + { + "r": "55", + "s": [ + { + "r": "54", + "s": [ + { + "value": [ + "LongTermFacilityEncounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "55", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\tintersect " + ] + }, + { + "r": "56", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "59", + "locator": "41:2-45:33", + "type": "Query", + "source": [ + { + "localId": "49", + "locator": "41:2-42:86", + "alias": "LongTermFacilityEncounter", + "expression": { + "localId": "48", + "locator": "41:2-42:60", + "type": "Union", + "operand": [ + { + "localId": "46", + "locator": "41:4-41:78", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Care Services in Long-Term Residential Facility", + "type": "ValueSetRef" + } + }, + { + "localId": "47", + "locator": "42:9-42:58", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Nursing Facility Visit", + "type": "ValueSetRef" + } + } + ] + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "53", + "locator": "43:3-43:78", + "type": "Overlaps", + "operand": [ + { + "localId": "51", + "locator": "43:9-43:48", + "path": "relevantPeriod", + "scope": "LongTermFacilityEncounter", + "type": "Property" + }, + { + "localId": "52", + "locator": "43:59-43:78", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + }, + "return": { + "localId": "58", + "locator": "44:3-45:33", + "expression": { + "localId": "57", + "locator": "44:10-45:33", + "type": "Intersect", + "operand": [ + { + "localId": "55", + "locator": "44:10-44:49", + "path": "relevantPeriod", + "scope": "LongTermFacilityEncounter", + "type": "Property" + }, + { + "localId": "56", + "locator": "45:14-45:33", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + }, + { + "localId": "78", + "locator": "47:1-53:30", + "name": "Inpatient Encounter with Advanced Illness", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "78", + "s": [ + { + "value": [ + "define ", + "\"Inpatient Encounter with Advanced Illness\"", + ":\n\t" + ] + }, + { + "r": "77", + "s": [ + { + "s": [ + { + "r": "62", + "s": [ + { + "r": "61", + "s": [ + { + "r": "61", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Acute Inpatient\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "InpatientEncounter" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "76", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "76", + "s": [ + { + "r": "69", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "68", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "68", + "s": [ + { + "s": [ + { + "r": "64", + "s": [ + { + "r": "63", + "s": [ + { + "s": [ + { + "value": [ + "InpatientEncounter", + ".", + "diagnoses" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Diagnosis" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "67", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "67", + "s": [ + { + "r": "65", + "s": [ + { + "value": [ + "Diagnosis" + ] + } + ] + }, + { + "value": [ + " in " + ] + }, + { + "r": "66", + "s": [ + { + "value": [ + "\"Advanced Illness\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\tand " + ] + }, + { + "r": "75", + "s": [ + { + "r": "71", + "s": [ + { + "r": "70", + "s": [ + { + "value": [ + "InpatientEncounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "71", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "75", + "s": [ + { + "value": [ + "starts " + ] + }, + { + "r": "74", + "s": [ + { + "value": [ + "2 ", + "years" + ] + } + ] + }, + { + "value": [ + " or less before" + ] + } + ] + }, + { + "value": [ + " \n\t\t\t" + ] + }, + { + "r": "73", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "72", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "77", + "locator": "48:2-53:30", + "type": "Query", + "source": [ + { + "localId": "62", + "locator": "48:2-48:63", + "alias": "InpatientEncounter", + "expression": { + "localId": "61", + "locator": "48:2-48:44", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Acute Inpatient", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "76", + "locator": "49:3-53:30", + "type": "And", + "operand": [ + { + "localId": "69", + "locator": "49:9-51:3", + "type": "Exists", + "operand": { + "localId": "68", + "locator": "49:16-51:3", + "type": "Query", + "source": [ + { + "localId": "64", + "locator": "49:18-49:55", + "alias": "Diagnosis", + "expression": { + "localId": "63", + "locator": "49:18-49:45", + "path": "diagnoses", + "scope": "InpatientEncounter", + "type": "Property" + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "67", + "locator": "50:5-50:41", + "type": "InValueSet", + "code": { + "localId": "65", + "locator": "50:11-50:19", + "name": "Diagnosis", + "type": "AliasRef" + }, + "valueset": { + "localId": "66", + "locator": "50:24-50:41", + "name": "Advanced Illness" + } + } + } + }, + { + "localId": "75", + "locator": "52:8-53:30", + "type": "In", + "operand": [ + { + "locator": "52:42-52:47", + "type": "Start", + "operand": { + "localId": "71", + "locator": "52:8-52:40", + "path": "relevantPeriod", + "scope": "InpatientEncounter", + "type": "Property" + } + }, + { + "locator": "52:49-52:63", + "lowClosed": true, + "highClosed": false, + "type": "Interval", + "low": { + "locator": "53:4-53:30", + "type": "Subtract", + "operand": [ + { + "localId": "73", + "locator": "53:4-53:30", + "type": "End", + "operand": { + "localId": "72", + "locator": "53:11-53:30", + "name": "Measurement Period", + "type": "ParameterRef" + } + }, + { + "localId": "74", + "locator": "52:49-52:55", + "value": 2, + "unit": "years", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "73", + "locator": "53:4-53:30", + "type": "End", + "operand": { + "localId": "72", + "locator": "53:11-53:30", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + } + ] + } + ] + } + } + }, + { + "localId": "92", + "locator": "55:1-58:30", + "name": "Dementia Medications In Year Before or During Measurement Period", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "92", + "s": [ + { + "value": [ + "define ", + "\"Dementia Medications In Year Before or During Measurement Period\"", + ":\n\t" + ] + }, + { + "r": "91", + "s": [ + { + "s": [ + { + "r": "80", + "s": [ + { + "r": "79", + "s": [ + { + "r": "79", + "s": [ + { + "value": [ + "[", + "\"Medication, Active\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Dementia Medications\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "DementiaMed" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "90", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "90", + "s": [ + { + "r": "82", + "s": [ + { + "r": "81", + "s": [ + { + "value": [ + "DementiaMed" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "82", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "89", + "s": [ + { + "value": [ + "Interval[" + ] + }, + { + "r": "86", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "86", + "s": [ + { + "r": "84", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "83", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + " - " + ] + }, + { + "r": "85", + "s": [ + { + "value": [ + "1 ", + "year" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + ", \n\t\t" + ] + }, + { + "r": "88", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "87", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "91", + "locator": "56:2-58:30", + "type": "Query", + "source": [ + { + "localId": "80", + "locator": "56:2-56:59", + "alias": "DementiaMed", + "expression": { + "localId": "79", + "locator": "56:2-56:47", + "dataType": "{urn:healthit-gov:qdm:v5_4}MedicationActive", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Dementia Medications", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "90", + "locator": "57:3-58:30", + "type": "Overlaps", + "operand": [ + { + "localId": "82", + "locator": "57:9-57:34", + "path": "relevantPeriod", + "scope": "DementiaMed", + "type": "Property" + }, + { + "localId": "89", + "locator": "57:45-58:30", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "localId": "86", + "locator": "57:54-57:95", + "type": "Subtract", + "operand": [ + { + "localId": "84", + "locator": "57:56-57:84", + "type": "Start", + "operand": { + "localId": "83", + "locator": "57:65-57:84", + "name": "Measurement Period", + "type": "ParameterRef" + } + }, + { + "localId": "85", + "locator": "57:88-57:93", + "value": 1, + "unit": "year", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "88", + "locator": "58:3-58:29", + "type": "End", + "operand": { + "localId": "87", + "locator": "58:10-58:29", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + } + ] + } + } + }, + { + "localId": "137", + "locator": "60:1-75:3", + "name": "Has Criteria Indicating Frailty", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "137", + "s": [ + { + "value": [ + "define ", + "\"Has Criteria Indicating Frailty\"", + ":\n\t" + ] + }, + { + "r": "136", + "s": [ + { + "r": "127", + "s": [ + { + "r": "118", + "s": [ + { + "r": "109", + "s": [ + { + "r": "100", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "99", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "99", + "s": [ + { + "s": [ + { + "r": "94", + "s": [ + { + "r": "93", + "s": [ + { + "r": "93", + "s": [ + { + "value": [ + "[", + "\"Device, Order\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Frailty Device\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "FrailtyDeviceOrder" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "98", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "98", + "s": [ + { + "r": "96", + "s": [ + { + "r": "95", + "s": [ + { + "value": [ + "FrailtyDeviceOrder" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "96", + "s": [ + { + "value": [ + "authorDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "during", + " " + ] + }, + { + "r": "97", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "108", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "107", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "107", + "s": [ + { + "s": [ + { + "r": "102", + "s": [ + { + "r": "101", + "s": [ + { + "r": "101", + "s": [ + { + "value": [ + "[", + "\"Device, Applied\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Frailty Device\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "FrailtyDeviceApplied" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "106", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "106", + "s": [ + { + "r": "104", + "s": [ + { + "r": "103", + "s": [ + { + "value": [ + "FrailtyDeviceApplied" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "104", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "105", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "117", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "116", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "116", + "s": [ + { + "s": [ + { + "r": "111", + "s": [ + { + "r": "110", + "s": [ + { + "r": "110", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Frailty Diagnosis\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "FrailtyDiagnosis" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "115", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "115", + "s": [ + { + "r": "113", + "s": [ + { + "r": "112", + "s": [ + { + "value": [ + "FrailtyDiagnosis" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "113", + "s": [ + { + "value": [ + "prevalencePeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "114", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "126", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "125", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "125", + "s": [ + { + "s": [ + { + "r": "120", + "s": [ + { + "r": "119", + "s": [ + { + "r": "119", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Frailty Encounter\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "FrailtyEncounter" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "124", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "124", + "s": [ + { + "r": "122", + "s": [ + { + "r": "121", + "s": [ + { + "value": [ + "FrailtyEncounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "122", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "123", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "135", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "134", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "134", + "s": [ + { + "s": [ + { + "r": "129", + "s": [ + { + "r": "128", + "s": [ + { + "r": "128", + "s": [ + { + "value": [ + "[", + "\"Symptom\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Frailty Symptom\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "FrailtySymptom" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "133", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "133", + "s": [ + { + "r": "131", + "s": [ + { + "r": "130", + "s": [ + { + "value": [ + "FrailtySymptom" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "131", + "s": [ + { + "value": [ + "prevalencePeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "132", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "136", + "locator": "61:2-75:3", + "type": "Or", + "operand": [ + { + "localId": "127", + "locator": "61:2-72:3", + "type": "Or", + "operand": [ + { + "localId": "118", + "locator": "61:2-69:3", + "type": "Or", + "operand": [ + { + "localId": "109", + "locator": "61:2-66:3", + "type": "Or", + "operand": [ + { + "localId": "100", + "locator": "61:2-63:2", + "type": "Exists", + "operand": { + "localId": "99", + "locator": "61:9-63:2", + "type": "Query", + "source": [ + { + "localId": "94", + "locator": "61:11-61:64", + "alias": "FrailtyDeviceOrder", + "expression": { + "localId": "93", + "locator": "61:11-61:45", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveDeviceOrder", + "templateId": "PositiveDeviceOrder", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Frailty Device", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "98", + "locator": "62:4-62:70", + "type": "In", + "operand": [ + { + "localId": "96", + "locator": "62:10-62:42", + "path": "authorDatetime", + "scope": "FrailtyDeviceOrder", + "type": "Property" + }, + { + "localId": "97", + "locator": "62:51-62:70", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + }, + { + "localId": "108", + "locator": "64:6-66:3", + "type": "Exists", + "operand": { + "localId": "107", + "locator": "64:13-66:3", + "type": "Query", + "source": [ + { + "localId": "102", + "locator": "64:15-64:72", + "alias": "FrailtyDeviceApplied", + "expression": { + "localId": "101", + "locator": "64:15-64:51", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveDeviceApplied", + "templateId": "PositiveDeviceApplied", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Frailty Device", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "106", + "locator": "65:5-65:75", + "type": "Overlaps", + "operand": [ + { + "localId": "104", + "locator": "65:11-65:45", + "path": "relevantPeriod", + "scope": "FrailtyDeviceApplied", + "type": "Property" + }, + { + "localId": "105", + "locator": "65:56-65:75", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + }, + { + "localId": "117", + "locator": "67:6-69:3", + "type": "Exists", + "operand": { + "localId": "116", + "locator": "67:13-69:3", + "type": "Query", + "source": [ + { + "localId": "111", + "locator": "67:15-67:65", + "alias": "FrailtyDiagnosis", + "expression": { + "localId": "110", + "locator": "67:15-67:48", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Frailty Diagnosis", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "115", + "locator": "68:5-68:73", + "type": "Overlaps", + "operand": [ + { + "localId": "113", + "locator": "68:11-68:43", + "path": "prevalencePeriod", + "scope": "FrailtyDiagnosis", + "type": "Property" + }, + { + "localId": "114", + "locator": "68:54-68:73", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + }, + { + "localId": "126", + "locator": "70:6-72:3", + "type": "Exists", + "operand": { + "localId": "125", + "locator": "70:13-72:3", + "type": "Query", + "source": [ + { + "localId": "120", + "locator": "70:15-70:76", + "alias": "FrailtyEncounter", + "expression": { + "localId": "119", + "locator": "70:15-70:59", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Frailty Encounter", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "124", + "locator": "71:5-71:71", + "type": "Overlaps", + "operand": [ + { + "localId": "122", + "locator": "71:11-71:41", + "path": "relevantPeriod", + "scope": "FrailtyEncounter", + "type": "Property" + }, + { + "localId": "123", + "locator": "71:52-71:71", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + }, + { + "localId": "135", + "locator": "73:6-75:3", + "type": "Exists", + "operand": { + "localId": "134", + "locator": "73:13-75:3", + "type": "Query", + "source": [ + { + "localId": "129", + "locator": "73:15-73:59", + "alias": "FrailtySymptom", + "expression": { + "localId": "128", + "locator": "73:15-73:44", + "dataType": "{urn:healthit-gov:qdm:v5_4}Symptom", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Frailty Symptom", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "133", + "locator": "74:5-74:71", + "type": "Overlaps", + "operand": [ + { + "localId": "131", + "locator": "74:11-74:41", + "path": "prevalencePeriod", + "scope": "FrailtySymptom", + "type": "Property" + }, + { + "localId": "132", + "locator": "74:52-74:71", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + } + }, + { + "localId": "180", + "locator": "77:1-90:3", + "name": "Advanced Illness and Frailty Exclusion Including Over Age 80", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "180", + "s": [ + { + "value": [ + "define ", + "\"Advanced Illness and Frailty Exclusion Including Over Age 80\"", + ":\n\t//If the measure includes populations age 80 and older, then use this logic:\n\t" + ] + }, + { + "r": "179", + "s": [ + { + "r": "164", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "163", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "163", + "s": [ + { + "s": [ + { + "r": "139", + "s": [ + { + "r": "138", + "s": [ + { + "r": "138", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Birthdate\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Birth date\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "BirthDate" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "162", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "162", + "s": [ + { + "r": "151", + "s": [ + { + "r": "149", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "149", + "s": [ + { + "r": "145", + "s": [ + { + "r": "140", + "s": [ + { + "value": [ + "Global" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "145", + "s": [ + { + "value": [ + "\"CalendarAgeInYearsAt\"", + "(" + ] + }, + { + "r": "142", + "s": [ + { + "r": "141", + "s": [ + { + "value": [ + "BirthDate" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "142", + "s": [ + { + "value": [ + "birthDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "144", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "143", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + "in " + ] + }, + { + "r": "148", + "s": [ + { + "value": [ + "Interval[", + "66", + ", ", + "80", + "]" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "150", + "s": [ + { + "value": [ + "\"Has Criteria Indicating Frailty\"" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "161", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "161", + "s": [ + { + "r": "158", + "s": [ + { + "r": "155", + "s": [ + { + "r": "153", + "s": [ + { + "value": [ + "Count", + "(" + ] + }, + { + "r": "152", + "s": [ + { + "value": [ + "\"Outpatient Encounters with Advanced Illness\"" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ">=", + " ", + "2" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t\t\tor " + ] + }, + { + "r": "157", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "156", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "156", + "s": [ + { + "value": [ + "\"Inpatient Encounter with Advanced Illness\"" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t\t\tor " + ] + }, + { + "r": "160", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "159", + "s": [ + { + "value": [ + "\"Dementia Medications In Year Before or During Measurement Period\"" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "178", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "177", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "177", + "s": [ + { + "s": [ + { + "r": "166", + "s": [ + { + "r": "165", + "s": [ + { + "r": "165", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Birthdate\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Birth date\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "BirthDate" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "176", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "176", + "s": [ + { + "r": "174", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "174", + "s": [ + { + "r": "172", + "s": [ + { + "r": "167", + "s": [ + { + "value": [ + "Global" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "172", + "s": [ + { + "value": [ + "\"CalendarAgeInYearsAt\"", + "(" + ] + }, + { + "r": "169", + "s": [ + { + "r": "168", + "s": [ + { + "value": [ + "BirthDate" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "169", + "s": [ + { + "value": [ + "birthDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "171", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "170", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + ">=", + " ", + "81" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t\tand " + ] + }, + { + "r": "175", + "s": [ + { + "value": [ + "\"Has Criteria Indicating Frailty\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "179", + "locator": "79:2-90:3", + "type": "Or", + "operand": [ + { + "localId": "164", + "locator": "79:2-86:2", + "type": "Exists", + "operand": { + "localId": "163", + "locator": "79:9-86:2", + "type": "Query", + "source": [ + { + "localId": "139", + "locator": "79:11-79:70", + "alias": "BirthDate", + "expression": { + "localId": "138", + "locator": "79:11-79:60", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicBirthdate", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "type": "ToList", + "operand": { + "name": "Birth date", + "type": "CodeRef" + } + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "162", + "locator": "80:4-85:5", + "type": "And", + "operand": [ + { + "localId": "151", + "locator": "80:10-81:41", + "type": "And", + "operand": [ + { + "localId": "149", + "locator": "80:10-80:116", + "type": "In", + "operand": [ + { + "localId": "145", + "locator": "80:12-80:96", + "name": "CalendarAgeInYearsAt", + "libraryName": "Global", + "type": "FunctionRef", + "operand": [ + { + "localId": "142", + "locator": "80:42-80:64", + "path": "birthDatetime", + "scope": "BirthDate", + "type": "Property" + }, + { + "localId": "144", + "locator": "80:67-80:95", + "type": "Start", + "operand": { + "localId": "143", + "locator": "80:76-80:95", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + ] + }, + { + "localId": "148", + "locator": "80:100-80:115", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "localId": "146", + "locator": "80:109-80:110", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "66", + "type": "Literal" + }, + "high": { + "localId": "147", + "locator": "80:113-80:114", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "80", + "type": "Literal" + } + } + ] + }, + { + "localId": "150", + "locator": "81:9-81:41", + "name": "Has Criteria Indicating Frailty", + "type": "ExpressionRef" + } + ] + }, + { + "localId": "161", + "locator": "82:9-85:5", + "type": "Or", + "operand": [ + { + "localId": "158", + "locator": "82:11-83:63", + "type": "Or", + "operand": [ + { + "localId": "155", + "locator": "82:11-82:66", + "type": "GreaterOrEqual", + "operand": [ + { + "localId": "153", + "locator": "82:11-82:62", + "type": "Count", + "source": { + "localId": "152", + "locator": "82:17-82:61", + "name": "Outpatient Encounters with Advanced Illness", + "type": "ExpressionRef" + } + }, + { + "localId": "154", + "locator": "82:66", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "type": "Literal" + } + ] + }, + { + "localId": "157", + "locator": "83:10-83:63", + "type": "Exists", + "operand": { + "localId": "156", + "locator": "83:17-83:63", + "name": "Inpatient Encounter with Advanced Illness", + "type": "ExpressionRef" + } + } + ] + }, + { + "localId": "160", + "locator": "84:10-84:82", + "type": "Exists", + "operand": { + "localId": "159", + "locator": "84:17-84:82", + "name": "Dementia Medications In Year Before or During Measurement Period", + "type": "ExpressionRef" + } + } + ] + } + ] + } + } + }, + { + "localId": "178", + "locator": "87:6-90:3", + "type": "Exists", + "operand": { + "localId": "177", + "locator": "87:13-90:3", + "type": "Query", + "source": [ + { + "localId": "166", + "locator": "87:15-87:74", + "alias": "BirthDate", + "expression": { + "localId": "165", + "locator": "87:15-87:64", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicBirthdate", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "type": "ToList", + "operand": { + "name": "Birth date", + "type": "CodeRef" + } + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "176", + "locator": "88:5-89:42", + "type": "And", + "operand": [ + { + "localId": "174", + "locator": "88:11-88:104", + "type": "GreaterOrEqual", + "operand": [ + { + "localId": "172", + "locator": "88:13-88:97", + "name": "CalendarAgeInYearsAt", + "libraryName": "Global", + "type": "FunctionRef", + "operand": [ + { + "localId": "169", + "locator": "88:43-88:65", + "path": "birthDatetime", + "scope": "BirthDate", + "type": "Property" + }, + { + "localId": "171", + "locator": "88:68-88:96", + "type": "Start", + "operand": { + "localId": "170", + "locator": "88:77-88:96", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + ] + }, + { + "localId": "173", + "locator": "88:101-88:102", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "81", + "type": "Literal" + } + ] + }, + { + "localId": "175", + "locator": "89:10-89:42", + "name": "Has Criteria Indicating Frailty", + "type": "ExpressionRef" + } + ] + } + } + } + ] + } + }, + { + "localId": "206", + "locator": "92:1-101:2", + "name": "Advanced Illness and Frailty Exclusion Including Under Age 80", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "206", + "s": [ + { + "value": [ + "define ", + "\"Advanced Illness and Frailty Exclusion Including Under Age 80\"", + ":\n\t//If the measure does NOT include populations age 80 and older, then use this logic:\n\t" + ] + }, + { + "r": "205", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "204", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "204", + "s": [ + { + "s": [ + { + "r": "182", + "s": [ + { + "r": "181", + "s": [ + { + "r": "181", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Birthdate\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Birth date\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "BirthDate" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "203", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "203", + "s": [ + { + "r": "192", + "s": [ + { + "r": "190", + "s": [ + { + "r": "188", + "s": [ + { + "r": "183", + "s": [ + { + "value": [ + "Global" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "188", + "s": [ + { + "value": [ + "\"CalendarAgeInYearsAt\"", + "(" + ] + }, + { + "r": "185", + "s": [ + { + "r": "184", + "s": [ + { + "value": [ + "BirthDate" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "185", + "s": [ + { + "value": [ + "birthDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "187", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "186", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + ">=", + " ", + "65" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "191", + "s": [ + { + "value": [ + "\"Has Criteria Indicating Frailty\"" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "202", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "202", + "s": [ + { + "r": "199", + "s": [ + { + "r": "196", + "s": [ + { + "r": "194", + "s": [ + { + "value": [ + "Count", + "(" + ] + }, + { + "r": "193", + "s": [ + { + "value": [ + "\"Outpatient Encounters with Advanced Illness\"" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ">=", + " ", + "2" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t\t\tor " + ] + }, + { + "r": "198", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "197", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "197", + "s": [ + { + "value": [ + "\"Inpatient Encounter with Advanced Illness\"" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t\t\tor " + ] + }, + { + "r": "201", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "200", + "s": [ + { + "value": [ + "\"Dementia Medications In Year Before or During Measurement Period\"" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t)" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "205", + "locator": "94:2-101:2", + "type": "Exists", + "operand": { + "localId": "204", + "locator": "94:9-101:2", + "type": "Query", + "source": [ + { + "localId": "182", + "locator": "94:11-94:70", + "alias": "BirthDate", + "expression": { + "localId": "181", + "locator": "94:11-94:60", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicBirthdate", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "type": "ToList", + "operand": { + "name": "Birth date", + "type": "CodeRef" + } + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "203", + "locator": "95:4-100:5", + "type": "And", + "operand": [ + { + "localId": "192", + "locator": "95:10-96:41", + "type": "And", + "operand": [ + { + "localId": "190", + "locator": "95:10-95:99", + "type": "GreaterOrEqual", + "operand": [ + { + "localId": "188", + "locator": "95:10-95:94", + "name": "CalendarAgeInYearsAt", + "libraryName": "Global", + "type": "FunctionRef", + "operand": [ + { + "localId": "185", + "locator": "95:40-95:62", + "path": "birthDatetime", + "scope": "BirthDate", + "type": "Property" + }, + { + "localId": "187", + "locator": "95:65-95:93", + "type": "Start", + "operand": { + "localId": "186", + "locator": "95:74-95:93", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + ] + }, + { + "localId": "189", + "locator": "95:98-95:99", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "65", + "type": "Literal" + } + ] + }, + { + "localId": "191", + "locator": "96:9-96:41", + "name": "Has Criteria Indicating Frailty", + "type": "ExpressionRef" + } + ] + }, + { + "localId": "202", + "locator": "97:9-100:5", + "type": "Or", + "operand": [ + { + "localId": "199", + "locator": "97:11-98:63", + "type": "Or", + "operand": [ + { + "localId": "196", + "locator": "97:11-97:66", + "type": "GreaterOrEqual", + "operand": [ + { + "localId": "194", + "locator": "97:11-97:62", + "type": "Count", + "source": { + "localId": "193", + "locator": "97:17-97:61", + "name": "Outpatient Encounters with Advanced Illness", + "type": "ExpressionRef" + } + }, + { + "localId": "195", + "locator": "97:66", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "2", + "type": "Literal" + } + ] + }, + { + "localId": "198", + "locator": "98:10-98:63", + "type": "Exists", + "operand": { + "localId": "197", + "locator": "98:17-98:63", + "name": "Inpatient Encounter with Advanced Illness", + "type": "ExpressionRef" + } + } + ] + }, + { + "localId": "201", + "locator": "99:10-99:82", + "type": "Exists", + "operand": { + "localId": "200", + "locator": "99:17-99:82", + "name": "Dementia Medications In Year Before or During Measurement Period", + "type": "ExpressionRef" + } + } + ] + } + ] + } + } + } + }, + { + "localId": "219", + "locator": "109:1-112:2", + "name": "CumulativeDays", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "219", + "s": [ + { + "value": [ + "define function ", + "\"CumulativeDays\"", + "(", + "Intervals", + " " + ] + }, + { + "r": "210", + "s": [ + { + "value": [ + "List<" + ] + }, + { + "r": "209", + "s": [ + { + "value": [ + "Interval<" + ] + }, + { + "r": "208", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + ">" + ] + } + ] + }, + { + "value": [ + ">" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "218", + "s": [ + { + "r": "218", + "s": [ + { + "value": [ + "Sum", + "(" + ] + }, + { + "r": "217", + "s": [ + { + "s": [ + { + "r": "213", + "s": [ + { + "r": "212", + "s": [ + { + "value": [ + "(" + ] + }, + { + "r": "212", + "s": [ + { + "value": [ + "collapse " + ] + }, + { + "r": "211", + "s": [ + { + "value": [ + "Intervals" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "CollapsedInterval" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "216", + "s": [ + { + "value": [ + "return all " + ] + }, + { + "r": "215", + "s": [ + { + "value": [ + "duration in days of " + ] + }, + { + "r": "214", + "s": [ + { + "value": [ + "CollapsedInterval" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "218", + "locator": "110:2-112:2", + "type": "Sum", + "source": { + "localId": "217", + "locator": "110:6-111:51", + "type": "Query", + "source": [ + { + "localId": "213", + "locator": "110:6-110:42", + "alias": "CollapsedInterval", + "expression": { + "localId": "212", + "locator": "110:6-110:25", + "type": "Collapse", + "operand": [ + { + "localId": "211", + "locator": "110:16-110:24", + "name": "Intervals", + "type": "OperandRef" + }, + { + "resultTypeName": "{urn:hl7-org:elm-types:r1}Quantity", + "type": "Null" + } + ] + } + } + ], + "relationship": [ + + ], + "return": { + "localId": "216", + "locator": "111:4-111:51", + "distinct": false, + "expression": { + "localId": "215", + "locator": "111:15-111:51", + "precision": "Day", + "type": "DurationBetween", + "operand": [ + { + "type": "Start", + "operand": { + "localId": "214", + "locator": "111:35-111:51", + "name": "CollapsedInterval", + "type": "AliasRef" + } + }, + { + "type": "End", + "operand": { + "localId": "214", + "locator": "111:35-111:51", + "name": "CollapsedInterval", + "type": "AliasRef" + } + } + ] + } + } + } + }, + "operand": [ + { + "name": "Intervals", + "operandTypeSpecifier": { + "localId": "210", + "locator": "109:44-109:67", + "type": "ListTypeSpecifier", + "elementType": { + "localId": "209", + "locator": "109:49-109:66", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "208", + "locator": "109:58-109:65", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + } + ] + }, + { + "localId": "221", + "locator": "106:1-107:69", + "name": "Days Spent in Long Term Care During Measurement Period", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "221", + "s": [ + { + "value": [ + "define ", + "\"Days Spent in Long Term Care During Measurement Period\"", + ":\n\t" + ] + }, + { + "r": "220", + "s": [ + { + "value": [ + "\"CumulativeDays\"", + "(" + ] + }, + { + "r": "207", + "s": [ + { + "value": [ + "\"Long Term Care Periods During Measurement Period\"" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "220", + "locator": "107:2-107:69", + "name": "CumulativeDays", + "type": "FunctionRef", + "operand": [ + { + "localId": "207", + "locator": "107:19-107:68", + "name": "Long Term Care Periods During Measurement Period", + "type": "ExpressionRef" + } + ] + } + }, + { + "localId": "225", + "locator": "103:1-104:62", + "name": "Has Spent More Than 90 Days in Long Term Care", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "225", + "s": [ + { + "value": [ + "define ", + "\"Has Spent More Than 90 Days in Long Term Care\"", + ":\n\t" + ] + }, + { + "r": "224", + "s": [ + { + "r": "222", + "s": [ + { + "value": [ + "\"Days Spent in Long Term Care During Measurement Period\"" + ] + } + ] + }, + { + "value": [ + " ", + ">", + " ", + "90" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "224", + "locator": "104:2-104:62", + "type": "Greater", + "operand": [ + { + "localId": "222", + "locator": "104:2-104:57", + "name": "Days Spent in Long Term Care During Measurement Period", + "type": "ExpressionRef" + }, + { + "localId": "223", + "locator": "104:61-104:62", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "90", + "type": "Literal" + } + ] + } + } + ] + } + } + }, + "elm_annotations": { + "statements": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Outpatient Encounters with Advanced Illness\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Outpatient\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "22" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Observation\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "23" + } + ], + "node_type": "Union", + "ref_id": "24" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"ED\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "25" + } + ], + "ref_id": "26" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Nonacute Inpatient\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "27" + } + ], + "node_type": "Union", + "ref_id": "28" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "Union", + "ref_id": "28" + }, + { + "children": [ + { + "text": " OutpatientEncounter" + } + ] + } + ], + "ref_id": "29" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "OutpatientEncounter.diagnoses" + } + ] + } + ] + } + ], + "node_type": "Property", + "ref_id": "30" + }, + { + "children": [ + { + "text": " Diagnosis" + } + ] + } + ], + "ref_id": "31" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Diagnosis" + } + ] + } + ], + "ref_id": "32" + }, + { + "children": [ + { + "text": " in " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Advanced Illness\"" + } + ] + } + ], + "ref_id": "33" + } + ], + "ref_id": "34" + } + ], + "ref_id": "34" + } + ], + "node_type": "Query", + "ref_id": "35" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "35" + } + ], + "node_type": "Exists", + "ref_id": "36" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "OutpatientEncounter" + } + ] + } + ], + "ref_id": "37" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "38" + } + ], + "node_type": "Property", + "ref_id": "38" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "starts " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "2 years" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "41" + }, + { + "children": [ + { + "text": " or less before" + } + ] + } + ], + "node_type": "In", + "ref_id": "42" + }, + { + "children": [ + { + "text": " \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "39" + } + ], + "node_type": "End", + "ref_id": "40" + } + ], + "node_type": "In", + "ref_id": "42" + } + ], + "ref_id": "43" + } + ], + "ref_id": "43" + } + ], + "node_type": "Query", + "ref_id": "44" + } + ], + "ref_id": "45" + } + ], + "define_name": "Outpatient Encounters with Advanced Illness" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Long Term Care Periods During Measurement Period\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Care Services in Long-Term Residential Facility\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "46" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Nursing Facility Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "47" + } + ], + "node_type": "Union", + "ref_id": "48" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "Union", + "ref_id": "48" + }, + { + "children": [ + { + "text": " LongTermFacilityEncounter" + } + ] + } + ], + "ref_id": "49" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LongTermFacilityEncounter" + } + ] + } + ], + "ref_id": "50" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "51" + } + ], + "node_type": "Property", + "ref_id": "51" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "52" + } + ], + "ref_id": "53" + } + ], + "ref_id": "53" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "return " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LongTermFacilityEncounter" + } + ] + } + ], + "ref_id": "54" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "55" + } + ], + "node_type": "Property", + "ref_id": "55" + }, + { + "children": [ + { + "text": "\n intersect " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "56" + } + ], + "node_type": "Intersect", + "ref_id": "57" + } + ], + "ref_id": "58" + } + ], + "node_type": "Query", + "ref_id": "59" + } + ], + "ref_id": "60" + } + ], + "define_name": "Long Term Care Periods During Measurement Period" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Inpatient Encounter with Advanced Illness\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Acute Inpatient\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "61" + } + ], + "node_type": "Retrieve", + "ref_id": "61" + }, + { + "children": [ + { + "text": " InpatientEncounter" + } + ] + } + ], + "ref_id": "62" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "InpatientEncounter.diagnoses" + } + ] + } + ] + } + ], + "node_type": "Property", + "ref_id": "63" + }, + { + "children": [ + { + "text": " Diagnosis" + } + ] + } + ], + "ref_id": "64" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Diagnosis" + } + ] + } + ], + "ref_id": "65" + }, + { + "children": [ + { + "text": " in " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Advanced Illness\"" + } + ] + } + ], + "ref_id": "66" + } + ], + "ref_id": "67" + } + ], + "ref_id": "67" + } + ], + "node_type": "Query", + "ref_id": "68" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "68" + } + ], + "node_type": "Exists", + "ref_id": "69" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "InpatientEncounter" + } + ] + } + ], + "ref_id": "70" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "71" + } + ], + "node_type": "Property", + "ref_id": "71" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "starts " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "2 years" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "74" + }, + { + "children": [ + { + "text": " or less before" + } + ] + } + ], + "node_type": "In", + "ref_id": "75" + }, + { + "children": [ + { + "text": " \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "72" + } + ], + "node_type": "End", + "ref_id": "73" + } + ], + "node_type": "In", + "ref_id": "75" + } + ], + "ref_id": "76" + } + ], + "ref_id": "76" + } + ], + "node_type": "Query", + "ref_id": "77" + } + ], + "ref_id": "78" + } + ], + "define_name": "Inpatient Encounter with Advanced Illness" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Dementia Medications In Year Before or During Measurement Period\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Medication, Active\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Dementia Medications\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "79" + } + ], + "node_type": "Retrieve", + "ref_id": "79" + }, + { + "children": [ + { + "text": " DementiaMed" + } + ] + } + ], + "ref_id": "80" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "DementiaMed" + } + ] + } + ], + "ref_id": "81" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "82" + } + ], + "node_type": "Property", + "ref_id": "82" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval[" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "83" + } + ], + "node_type": "Start", + "ref_id": "84" + }, + { + "children": [ + { + "text": " - " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 year" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "85" + } + ], + "ref_id": "86" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "ref_id": "86" + }, + { + "children": [ + { + "text": ", \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "87" + } + ], + "ref_id": "88" + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Interval", + "ref_id": "89" + } + ], + "ref_id": "90" + } + ], + "ref_id": "90" + } + ], + "node_type": "Query", + "ref_id": "91" + } + ], + "ref_id": "92" + } + ], + "define_name": "Dementia Medications In Year Before or During Measurement Period" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Has Criteria Indicating Frailty\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Device, Order\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Frailty Device\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "93" + } + ], + "node_type": "Retrieve", + "ref_id": "93" + }, + { + "children": [ + { + "text": " FrailtyDeviceOrder" + } + ] + } + ], + "ref_id": "94" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtyDeviceOrder" + } + ] + } + ], + "ref_id": "95" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "authorDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "96" + } + ], + "node_type": "Property", + "ref_id": "96" + }, + { + "children": [ + { + "text": " during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "97" + } + ], + "ref_id": "98" + } + ], + "ref_id": "98" + } + ], + "node_type": "Query", + "ref_id": "99" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "99" + } + ], + "node_type": "Exists", + "ref_id": "100" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Device, Applied\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Frailty Device\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "101" + } + ], + "node_type": "Retrieve", + "ref_id": "101" + }, + { + "children": [ + { + "text": " FrailtyDeviceApplied" + } + ] + } + ], + "ref_id": "102" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtyDeviceApplied" + } + ] + } + ], + "ref_id": "103" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "104" + } + ], + "node_type": "Property", + "ref_id": "104" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "105" + } + ], + "ref_id": "106" + } + ], + "ref_id": "106" + } + ], + "node_type": "Query", + "ref_id": "107" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "107" + } + ], + "node_type": "Exists", + "ref_id": "108" + } + ], + "node_type": "Or", + "ref_id": "109" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Frailty Diagnosis\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "110" + } + ], + "node_type": "Retrieve", + "ref_id": "110" + }, + { + "children": [ + { + "text": " FrailtyDiagnosis" + } + ] + } + ], + "ref_id": "111" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtyDiagnosis" + } + ] + } + ], + "ref_id": "112" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "prevalencePeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "113" + } + ], + "node_type": "Property", + "ref_id": "113" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "114" + } + ], + "ref_id": "115" + } + ], + "ref_id": "115" + } + ], + "node_type": "Query", + "ref_id": "116" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "116" + } + ], + "node_type": "Exists", + "ref_id": "117" + } + ], + "node_type": "Or", + "ref_id": "118" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Frailty Encounter\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "119" + } + ], + "node_type": "Retrieve", + "ref_id": "119" + }, + { + "children": [ + { + "text": " FrailtyEncounter" + } + ] + } + ], + "ref_id": "120" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtyEncounter" + } + ] + } + ], + "ref_id": "121" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "122" + } + ], + "node_type": "Property", + "ref_id": "122" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "123" + } + ], + "ref_id": "124" + } + ], + "ref_id": "124" + } + ], + "node_type": "Query", + "ref_id": "125" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "125" + } + ], + "node_type": "Exists", + "ref_id": "126" + } + ], + "node_type": "Or", + "ref_id": "127" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Symptom\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Frailty Symptom\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "128" + } + ], + "node_type": "Retrieve", + "ref_id": "128" + }, + { + "children": [ + { + "text": " FrailtySymptom" + } + ] + } + ], + "ref_id": "129" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtySymptom" + } + ] + } + ], + "ref_id": "130" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "prevalencePeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "131" + } + ], + "node_type": "Property", + "ref_id": "131" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "132" + } + ], + "ref_id": "133" + } + ], + "ref_id": "133" + } + ], + "node_type": "Query", + "ref_id": "134" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "134" + } + ], + "node_type": "Exists", + "ref_id": "135" + } + ], + "node_type": "Or", + "ref_id": "136" + } + ], + "ref_id": "137" + } + ], + "define_name": "Has Criteria Indicating Frailty" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Advanced Illness and Frailty Exclusion Including Over Age 80\":\n //If the measure includes populations age 80 and older, then use this logic:\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Birthdate\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Birth date\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "138" + } + ], + "node_type": "Retrieve", + "ref_id": "138" + }, + { + "children": [ + { + "text": " BirthDate" + } + ] + } + ], + "ref_id": "139" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Global" + } + ] + } + ], + "ref_id": "140" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"CalendarAgeInYearsAt\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "BirthDate" + } + ] + } + ], + "ref_id": "141" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "birthDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "142" + } + ], + "node_type": "Property", + "ref_id": "142" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "143" + } + ], + "node_type": "Start", + "ref_id": "144" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "145" + } + ], + "node_type": "FunctionRef", + "ref_id": "145" + }, + { + "children": [ + { + "text": "in " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval[66, 80]" + } + ] + } + ], + "node_type": "Interval", + "ref_id": "148" + } + ], + "node_type": "In", + "ref_id": "149" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "In", + "ref_id": "149" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Has Criteria Indicating Frailty\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "150" + } + ], + "node_type": "And", + "ref_id": "151" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Count(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Outpatient Encounters with Advanced Illness\"" + } + ] + } + ], + "ref_id": "152" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Count", + "ref_id": "153" + }, + { + "children": [ + { + "text": ">= 2" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "155" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Inpatient Encounter with Advanced Illness\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "156" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "156" + } + ], + "node_type": "Exists", + "ref_id": "157" + } + ], + "node_type": "Or", + "ref_id": "158" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Dementia Medications In Year Before or During Measurement Period\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "159" + } + ], + "node_type": "Exists", + "ref_id": "160" + } + ], + "node_type": "Or", + "ref_id": "161" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Or", + "ref_id": "161" + } + ], + "ref_id": "162" + } + ], + "ref_id": "162" + } + ], + "node_type": "Query", + "ref_id": "163" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "163" + } + ], + "node_type": "Exists", + "ref_id": "164" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Birthdate\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Birth date\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "165" + } + ], + "node_type": "Retrieve", + "ref_id": "165" + }, + { + "children": [ + { + "text": " BirthDate" + } + ] + } + ], + "ref_id": "166" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Global" + } + ] + } + ], + "ref_id": "167" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"CalendarAgeInYearsAt\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "BirthDate" + } + ] + } + ], + "ref_id": "168" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "birthDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "169" + } + ], + "node_type": "Property", + "ref_id": "169" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "170" + } + ], + "node_type": "Start", + "ref_id": "171" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "172" + } + ], + "node_type": "FunctionRef", + "ref_id": "172" + }, + { + "children": [ + { + "text": ">= 81" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "174" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "174" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Has Criteria Indicating Frailty\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "175" + } + ], + "ref_id": "176" + } + ], + "ref_id": "176" + } + ], + "node_type": "Query", + "ref_id": "177" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "177" + } + ], + "node_type": "Exists", + "ref_id": "178" + } + ], + "node_type": "Or", + "ref_id": "179" + } + ], + "ref_id": "180" + } + ], + "define_name": "Advanced Illness and Frailty Exclusion Including Over Age 80" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Advanced Illness and Frailty Exclusion Including Under Age 80\":\n //If the measure does NOT include populations age 80 and older, then use this logic:\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Birthdate\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Birth date\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "181" + } + ], + "node_type": "Retrieve", + "ref_id": "181" + }, + { + "children": [ + { + "text": " BirthDate" + } + ] + } + ], + "ref_id": "182" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Global" + } + ] + } + ], + "ref_id": "183" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"CalendarAgeInYearsAt\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "BirthDate" + } + ] + } + ], + "ref_id": "184" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "birthDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "185" + } + ], + "node_type": "Property", + "ref_id": "185" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "186" + } + ], + "node_type": "Start", + "ref_id": "187" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "188" + } + ], + "node_type": "FunctionRef", + "ref_id": "188" + }, + { + "children": [ + { + "text": ">= 65" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "190" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Has Criteria Indicating Frailty\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "191" + } + ], + "node_type": "And", + "ref_id": "192" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Count(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Outpatient Encounters with Advanced Illness\"" + } + ] + } + ], + "ref_id": "193" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Count", + "ref_id": "194" + }, + { + "children": [ + { + "text": ">= 2" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "196" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Inpatient Encounter with Advanced Illness\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "197" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "197" + } + ], + "node_type": "Exists", + "ref_id": "198" + } + ], + "node_type": "Or", + "ref_id": "199" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Dementia Medications In Year Before or During Measurement Period\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "200" + } + ], + "node_type": "Exists", + "ref_id": "201" + } + ], + "node_type": "Or", + "ref_id": "202" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Or", + "ref_id": "202" + } + ], + "ref_id": "203" + } + ], + "ref_id": "203" + } + ], + "node_type": "Query", + "ref_id": "204" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "204" + } + ], + "node_type": "Exists", + "ref_id": "205" + } + ], + "ref_id": "206" + } + ], + "define_name": "Advanced Illness and Frailty Exclusion Including Under Age 80" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CumulativeDays\"(Intervals " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "List<" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval<" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "208" + }, + { + "children": [ + { + "text": ">" + } + ] + } + ], + "ref_id": "209" + }, + { + "children": [ + { + "text": ">" + } + ] + } + ], + "ref_id": "210" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Sum(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "collapse " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Intervals" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "211" + } + ], + "node_type": "Collapse", + "ref_id": "212" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Collapse", + "ref_id": "212" + }, + { + "children": [ + { + "text": "CollapsedInterval" + } + ] + } + ], + "ref_id": "213" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "return all " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "duration in days of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "CollapsedInterval" + } + ] + } + ], + "node_type": "AliasRef", + "ref_id": "214" + } + ], + "node_type": "DurationBetween", + "ref_id": "215" + } + ], + "ref_id": "216" + } + ], + "ref_id": "217" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Sum", + "ref_id": "218" + } + ], + "node_type": "Sum", + "ref_id": "218" + } + ], + "ref_id": "219" + } + ], + "define_name": "CumulativeDays" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Days Spent in Long Term Care During Measurement Period\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"CumulativeDays\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Long Term Care Periods During Measurement Period\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "207" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "220" + } + ], + "ref_id": "221" + } + ], + "define_name": "Days Spent in Long Term Care During Measurement Period" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Has Spent More Than 90 Days in Long Term Care\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "\"Days Spent in Long Term Care During Measurement Period\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "222" + }, + { + "children": [ + { + "text": " > 90" + } + ] + } + ], + "node_type": "Greater", + "ref_id": "224" + } + ], + "ref_id": "225" + } + ], + "define_name": "Has Spent More Than 90 Days in Long Term Care" + } + ], + "identifier": { + "id": "AdvancedIllnessandFrailtyExclusionECQM", + "version": "4.0.000" + } + }, + "is_main_library": false, + "is_top_level": true, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "library_version": "4.0.000", + "statement_dependencies": [ + { + "_id": "6500d365e77bbf53b55d218e", + "statement_name": "Has Spent More Than 90 Days in Long Term Care", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d218f", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Days Spent in Long Term Care During Measurement Period" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d2190", + "statement_name": "Days Spent in Long Term Care During Measurement Period", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d2191", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "CumulativeDays" + }, + { + "_id": "6500d365e77bbf53b55d2192", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Long Term Care Periods During Measurement Period" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d2193", + "statement_name": "CumulativeDays" + }, + { + "_id": "6500d365e77bbf53b55d2194", + "statement_name": "Long Term Care Periods During Measurement Period" + }, + { + "_id": "6500d365e77bbf53b55d2195", + "statement_name": "Advanced Illness and Frailty Exclusion Including Under Age 80", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d2196", + "hqmf_id": null, + "library_name": "MATGlobalCommonFunctions", + "statement_name": "CalendarAgeInYearsAt" + }, + { + "_id": "6500d365e77bbf53b55d2197", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Has Criteria Indicating Frailty" + }, + { + "_id": "6500d365e77bbf53b55d2198", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Outpatient Encounters with Advanced Illness" + }, + { + "_id": "6500d365e77bbf53b55d2199", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Inpatient Encounter with Advanced Illness" + }, + { + "_id": "6500d365e77bbf53b55d219a", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Dementia Medications In Year Before or During Measurement Period" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d219b", + "statement_name": "Has Criteria Indicating Frailty" + }, + { + "_id": "6500d365e77bbf53b55d219c", + "statement_name": "Outpatient Encounters with Advanced Illness" + }, + { + "_id": "6500d365e77bbf53b55d219d", + "statement_name": "Inpatient Encounter with Advanced Illness" + }, + { + "_id": "6500d365e77bbf53b55d219e", + "statement_name": "Dementia Medications In Year Before or During Measurement Period" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d219f", + "cql": "library DiabetesMedicalAttentionforNephropathy version '8.4.000'\r\n\r\nusing QDM version '5.4'\r\n\r\ninclude Adult_Outpatient_Encounters version '1.2.000' called AdultOutpatientEncounters\r\ninclude MATGlobalCommonFunctions version '4.0.000' called Global\r\ninclude Hospice version '2.0.000' called Hospice\r\ninclude AdvancedIllnessandFrailtyExclusionECQM version '4.0.000' called FrailtyLTI\r\n\r\ncodesystem \"LOINC\": 'urn:oid:2.16.840.1.113883.6.1'\r\n\r\nvalueset \"ACE Inhibitor or ARB\": 'urn:oid:2.16.840.1.113883.3.526.3.1139'\r\nvalueset \"Diabetes\": 'urn:oid:2.16.840.1.113883.3.464.1003.103.12.1001'\r\nvalueset \"Diabetic Nephropathy\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1004'\r\nvalueset \"Dialysis Education\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1016'\r\nvalueset \"Dialysis Services\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1013'\r\nvalueset \"ESRD Monthly Outpatient Services\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1014'\r\nvalueset \"Ethnicity\": 'urn:oid:2.16.840.1.114222.4.11.837'\r\nvalueset \"Glomerulonephritis and Nephrotic Syndrome\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1018'\r\nvalueset \"Hypertensive Chronic Kidney Disease\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1017'\r\nvalueset \"Kidney Failure\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1028'\r\nvalueset \"Kidney Transplant\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1012'\r\nvalueset \"ONC Administrative Sex\": 'urn:oid:2.16.840.1.113762.1.4.1'\r\nvalueset \"Other Services Related to Dialysis\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1015'\r\nvalueset \"Payer\": 'urn:oid:2.16.840.1.114222.4.11.3591'\r\nvalueset \"Proteinuria\": 'urn:oid:2.16.840.1.113883.3.526.3.1003'\r\nvalueset \"Race\": 'urn:oid:2.16.840.1.114222.4.11.836'\r\nvalueset \"Urine Protein Tests\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1024'\r\nvalueset \"Vascular Access for Dialysis\": 'urn:oid:2.16.840.1.113883.3.464.1003.109.12.1011'\r\n\r\ncode \"Birth date\": '21112-8' from \"LOINC\" display 'Birth date'\r\n\r\nparameter \"Measurement Period\" Interval\r\n\r\ncontext Patient\r\n\r\ndefine \"SDE Ethnicity\":\r\n\t[\"Patient Characteristic Ethnicity\": \"Ethnicity\"]\r\n\r\ndefine \"SDE Payer\":\r\n\t[\"Patient Characteristic Payer\": \"Payer\"]\r\n\r\ndefine \"SDE Race\":\r\n\t[\"Patient Characteristic Race\": \"Race\"]\r\n\r\ndefine \"SDE Sex\":\r\n\t[\"Patient Characteristic Sex\": \"ONC Administrative Sex\"]\r\n\r\ndefine \"Renal Procedures\":\r\n\t( [\"Procedure, Performed\": \"Kidney Transplant\"]\r\n\t\t\tunion [\"Procedure, Performed\": \"Vascular Access for Dialysis\"]\r\n\t\t\tunion [\"Procedure, Performed\": \"Dialysis Services\"]\r\n\t)\r\n\r\ndefine \"Renal Interventions\":\r\n\t[\"Intervention, Performed\": \"Other Services Related to Dialysis\"]\r\n\t\tunion [\"Intervention, Performed\": \"Dialysis Education\"]\r\n\r\ndefine \"Nephropathy Diagnoses\":\r\n\t( [\"Diagnosis\": \"Hypertensive Chronic Kidney Disease\"]\r\n\t\tunion [\"Diagnosis\": \"Kidney Failure\"]\r\n\t\tunion [\"Diagnosis\": \"Glomerulonephritis and Nephrotic Syndrome\"]\r\n\t\tunion [\"Diagnosis\": \"Diabetic Nephropathy\"]\r\n\t\tunion [\"Diagnosis\": \"Proteinuria\"] ) NephropathyDiagnoses\r\n\t\twhere NephropathyDiagnoses.prevalencePeriod overlaps \"Measurement Period\"\r\n\r\ndefine \"Denominator\":\r\n\t\"Initial Population\"\r\n\r\ndefine \"Protein Urea Lab Test\":\r\n\t[\"Laboratory Test, Performed\": \"Urine Protein Tests\"] ProteinUreaResult\r\n\t\twhere ProteinUreaResult.result is not null\r\n\r\ndefine \"End Stage Renal Disease Encounter\":\r\n\t[\"Encounter, Performed\": \"ESRD Monthly Outpatient Services\"]\r\n\r\ndefine \"Numerator\":\r\n\texists ( \"Active ACE or ARB Medications\" )\r\n\t\tor exists ( \"Nephropathy Diagnoses\" )\r\n\t\tor exists ( \"Nephropathy Screenings\" )\r\n\r\ndefine \"Active ACE or ARB Medications\":\r\n\t[\"Medication, Active\": \"ACE Inhibitor or ARB\"] ACEorARBMedication\r\n\t\twhere ACEorARBMedication.relevantPeriod overlaps \"Measurement Period\"\r\n\r\ndefine \"Nephropathy Screenings\":\r\n\t( \"Renal Procedures\"\r\n\t\tunion \"Renal Interventions\"\r\n\t\tunion \"End Stage Renal Disease Encounter\"\r\n\t\tunion \"Protein Urea Lab Test\" ) ScreeningNephropathy\r\n\t\twhere ScreeningNephropathy.relevantPeriod during \"Measurement Period\"\r\n\r\ndefine \"Initial Population\":\r\n\texists ( [\"Patient Characteristic Birthdate\": \"Birth date\"] BirthDate\r\n\t\t\twhere Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")in Interval[18, 75 )\r\n\t)\r\n\t\tand exists ( AdultOutpatientEncounters.\"Qualifying Encounters\" )\r\n\t\tand exists ( [\"Diagnosis\": \"Diabetes\"] Diabetes\r\n\t\t\t\twhere Diabetes.prevalencePeriod overlaps \"Measurement Period\"\r\n\t\t)\r\n\r\ndefine \"Denominator Exclusions\":\r\n\texists ( [\"Patient Characteristic Birthdate\": \"Birth date\"] BirthDate\r\n\t\t\twhere ( Global.\"CalendarAgeInYearsAt\"(BirthDate.birthDatetime, start of \"Measurement Period\")>= 65 )\r\n\t\t\t\tand FrailtyLTI.\"Has Spent More Than 90 Days in Long Term Care\"\r\n\t)\r\n\t\tor FrailtyLTI.\"Advanced Illness and Frailty Exclusion Including Under Age 80\"\r\n\t\tor Hospice.\"Has Hospice\"", + "elm": { + "library": { + "identifier": { + "id": "DiabetesMedicalAttentionforNephropathy", + "version": "8.4.000" + }, + "schemaIdentifier": { + "id": "urn:hl7-org:elm", + "version": "r1" + }, + "usings": { + "def": [ + { + "localIdentifier": "System", + "uri": "urn:hl7-org:elm-types:r1" + }, + { + "localId": "1", + "locator": "3:1-3:23", + "localIdentifier": "QDM", + "uri": "urn:healthit-gov:qdm:v5_4", + "version": "5.4" + } + ] + }, + "includes": { + "def": [ + { + "localId": "2", + "locator": "5:1-5:86", + "localIdentifier": "AdultOutpatientEncounters", + "path": "Adult_Outpatient_Encounters", + "version": "1.2.000" + }, + { + "localId": "3", + "locator": "6:1-6:64", + "localIdentifier": "Global", + "path": "MATGlobalCommonFunctions", + "version": "4.0.000" + }, + { + "localId": "4", + "locator": "7:1-7:48", + "localIdentifier": "Hospice", + "path": "Hospice", + "version": "2.0.000" + }, + { + "localId": "5", + "locator": "8:1-8:82", + "localIdentifier": "FrailtyLTI", + "path": "AdvancedIllnessandFrailtyExclusionECQM", + "version": "4.0.000" + } + ] + }, + "parameters": { + "def": [ + { + "localId": "29", + "locator": "33:1-33:49", + "name": "Measurement Period", + "accessLevel": "Public", + "parameterTypeSpecifier": { + "localId": "28", + "locator": "33:32-33:49", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "27", + "locator": "33:41-33:48", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + ] + }, + "codeSystems": { + "def": [ + { + "localId": "6", + "locator": "10:1-10:51", + "name": "LOINC", + "id": "2.16.840.1.113883.6.1", + "accessLevel": "Public" + } + ] + }, + "valueSets": { + "def": [ + { + "localId": "7", + "locator": "12:1-12:73", + "name": "ACE Inhibitor or ARB", + "id": "2.16.840.1.113883.3.526.3.1139", + "accessLevel": "Public" + }, + { + "localId": "8", + "locator": "13:1-13:71", + "name": "Diabetes", + "id": "2.16.840.1.113883.3.464.1003.103.12.1001", + "accessLevel": "Public" + }, + { + "localId": "9", + "locator": "14:1-14:83", + "name": "Diabetic Nephropathy", + "id": "2.16.840.1.113883.3.464.1003.109.12.1004", + "accessLevel": "Public" + }, + { + "localId": "10", + "locator": "15:1-15:81", + "name": "Dialysis Education", + "id": "2.16.840.1.113883.3.464.1003.109.12.1016", + "accessLevel": "Public" + }, + { + "localId": "11", + "locator": "16:1-16:80", + "name": "Dialysis Services", + "id": "2.16.840.1.113883.3.464.1003.109.12.1013", + "accessLevel": "Public" + }, + { + "localId": "12", + "locator": "17:1-17:95", + "name": "ESRD Monthly Outpatient Services", + "id": "2.16.840.1.113883.3.464.1003.109.12.1014", + "accessLevel": "Public" + }, + { + "localId": "13", + "locator": "18:1-18:58", + "name": "Ethnicity", + "id": "2.16.840.1.114222.4.11.837", + "accessLevel": "Public" + }, + { + "localId": "14", + "locator": "19:1-19:104", + "name": "Glomerulonephritis and Nephrotic Syndrome", + "id": "2.16.840.1.113883.3.464.1003.109.12.1018", + "accessLevel": "Public" + }, + { + "localId": "15", + "locator": "20:1-20:98", + "name": "Hypertensive Chronic Kidney Disease", + "id": "2.16.840.1.113883.3.464.1003.109.12.1017", + "accessLevel": "Public" + }, + { + "localId": "16", + "locator": "21:1-21:77", + "name": "Kidney Failure", + "id": "2.16.840.1.113883.3.464.1003.109.12.1028", + "accessLevel": "Public" + }, + { + "localId": "17", + "locator": "22:1-22:80", + "name": "Kidney Transplant", + "id": "2.16.840.1.113883.3.464.1003.109.12.1012", + "accessLevel": "Public" + }, + { + "localId": "18", + "locator": "23:1-23:68", + "name": "ONC Administrative Sex", + "id": "2.16.840.1.113762.1.4.1", + "accessLevel": "Public" + }, + { + "localId": "19", + "locator": "24:1-24:97", + "name": "Other Services Related to Dialysis", + "id": "2.16.840.1.113883.3.464.1003.109.12.1015", + "accessLevel": "Public" + }, + { + "localId": "20", + "locator": "25:1-25:55", + "name": "Payer", + "id": "2.16.840.1.114222.4.11.3591", + "accessLevel": "Public" + }, + { + "localId": "21", + "locator": "26:1-26:64", + "name": "Proteinuria", + "id": "2.16.840.1.113883.3.526.3.1003", + "accessLevel": "Public" + }, + { + "localId": "22", + "locator": "27:1-27:53", + "name": "Race", + "id": "2.16.840.1.114222.4.11.836", + "accessLevel": "Public" + }, + { + "localId": "23", + "locator": "28:1-28:82", + "name": "Urine Protein Tests", + "id": "2.16.840.1.113883.3.464.1003.109.12.1024", + "accessLevel": "Public" + }, + { + "localId": "24", + "locator": "29:1-29:91", + "name": "Vascular Access for Dialysis", + "id": "2.16.840.1.113883.3.464.1003.109.12.1011", + "accessLevel": "Public" + } + ] + }, + "codes": { + "def": [ + { + "localId": "26", + "locator": "31:1-31:62", + "name": "Birth date", + "id": "21112-8", + "display": "Birth date", + "accessLevel": "Public", + "codeSystem": { + "localId": "25", + "locator": "31:35-31:41", + "name": "LOINC" + } + } + ] + }, + "statements": { + "def": [ + { + "locator": "35:1-35:15", + "name": "Patient", + "context": "Patient", + "expression": { + "type": "SingletonFrom", + "operand": { + "locator": "35:1-35:15", + "dataType": "{urn:healthit-gov:qdm:v5_4}Patient", + "templateId": "Patient", + "type": "Retrieve" + } + } + }, + { + "localId": "31", + "locator": "37:1-38:50", + "name": "SDE Ethnicity", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "31", + "s": [ + { + "value": [ + "define ", + "\"SDE Ethnicity\"", + ":\n\t" + ] + }, + { + "r": "30", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Ethnicity\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Ethnicity\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "30", + "locator": "38:2-38:50", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicEthnicity", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Ethnicity", + "type": "ValueSetRef" + } + } + }, + { + "localId": "33", + "locator": "40:1-41:42", + "name": "SDE Payer", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "33", + "s": [ + { + "value": [ + "define ", + "\"SDE Payer\"", + ":\n\t" + ] + }, + { + "r": "32", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Payer\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Payer\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "32", + "locator": "41:2-41:42", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicPayer", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Payer", + "type": "ValueSetRef" + } + } + }, + { + "localId": "35", + "locator": "43:1-44:40", + "name": "SDE Race", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "35", + "s": [ + { + "value": [ + "define ", + "\"SDE Race\"", + ":\n\t" + ] + }, + { + "r": "34", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Race\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Race\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "34", + "locator": "44:2-44:40", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicRace", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Race", + "type": "ValueSetRef" + } + } + }, + { + "localId": "37", + "locator": "46:1-47:57", + "name": "SDE Sex", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "37", + "s": [ + { + "value": [ + "define ", + "\"SDE Sex\"", + ":\n\t" + ] + }, + { + "r": "36", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Sex\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"ONC Administrative Sex\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "36", + "locator": "47:2-47:57", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicSex", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "ONC Administrative Sex", + "type": "ValueSetRef" + } + } + }, + { + "localId": "43", + "locator": "49:1-53:2", + "name": "Renal Procedures", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "43", + "s": [ + { + "value": [ + "define ", + "\"Renal Procedures\"", + ":\n\t" + ] + }, + { + "r": "42", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "42", + "s": [ + { + "r": "40", + "s": [ + { + "r": "38", + "s": [ + { + "value": [ + "[", + "\"Procedure, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Kidney Transplant\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + }, + { + "value": [ + "\n\t\t\tunion " + ] + }, + { + "r": "39", + "s": [ + { + "value": [ + "[", + "\"Procedure, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Vascular Access for Dialysis\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\tunion " + ] + }, + { + "r": "41", + "s": [ + { + "value": [ + "[", + "\"Procedure, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Dialysis Services\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "42", + "locator": "50:2-53:2", + "type": "Union", + "operand": [ + { + "localId": "40", + "locator": "50:4-51:65", + "type": "Union", + "operand": [ + { + "localId": "38", + "locator": "50:4-50:48", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "templateId": "PositiveProcedurePerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Kidney Transplant", + "type": "ValueSetRef" + } + }, + { + "localId": "39", + "locator": "51:10-51:65", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "templateId": "PositiveProcedurePerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Vascular Access for Dialysis", + "type": "ValueSetRef" + } + } + ] + }, + { + "localId": "41", + "locator": "52:10-52:54", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "templateId": "PositiveProcedurePerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Dialysis Services", + "type": "ValueSetRef" + } + } + ] + } + }, + { + "localId": "47", + "locator": "55:1-57:57", + "name": "Renal Interventions", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "47", + "s": [ + { + "value": [ + "define ", + "\"Renal Interventions\"", + ":\n\t" + ] + }, + { + "r": "46", + "s": [ + { + "r": "44", + "s": [ + { + "value": [ + "[", + "\"Intervention, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Other Services Related to Dialysis\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "45", + "s": [ + { + "value": [ + "[", + "\"Intervention, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Dialysis Education\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "46", + "locator": "56:2-57:57", + "type": "Union", + "operand": [ + { + "localId": "44", + "locator": "56:2-56:66", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "templateId": "PositiveInterventionPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Other Services Related to Dialysis", + "type": "ValueSetRef" + } + }, + { + "localId": "45", + "locator": "57:9-57:57", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "templateId": "PositiveInterventionPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Dialysis Education", + "type": "ValueSetRef" + } + } + ] + } + }, + { + "localId": "63", + "locator": "59:1-65:75", + "name": "Nephropathy Diagnoses", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "63", + "s": [ + { + "value": [ + "define ", + "\"Nephropathy Diagnoses\"", + ":\n\t" + ] + }, + { + "r": "62", + "s": [ + { + "s": [ + { + "r": "57", + "s": [ + { + "r": "56", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "56", + "s": [ + { + "r": "54", + "s": [ + { + "r": "52", + "s": [ + { + "r": "50", + "s": [ + { + "r": "48", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Hypertensive Chronic Kidney Disease\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "49", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Kidney Failure\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "51", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Glomerulonephritis and Nephrotic Syndrome\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "53", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Diabetic Nephropathy\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "55", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Proteinuria\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + " ", + "NephropathyDiagnoses" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "61", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "61", + "s": [ + { + "r": "59", + "s": [ + { + "r": "58", + "s": [ + { + "value": [ + "NephropathyDiagnoses" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "59", + "s": [ + { + "value": [ + "prevalencePeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "60", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "62", + "locator": "60:2-65:75", + "type": "Query", + "source": [ + { + "localId": "57", + "locator": "60:2-64:59", + "alias": "NephropathyDiagnoses", + "expression": { + "localId": "56", + "locator": "60:2-64:38", + "type": "Union", + "operand": [ + { + "localId": "54", + "locator": "60:4-63:45", + "type": "Union", + "operand": [ + { + "localId": "50", + "locator": "60:4-61:39", + "type": "Union", + "operand": [ + { + "localId": "48", + "locator": "60:4-60:55", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Hypertensive Chronic Kidney Disease", + "type": "ValueSetRef" + } + }, + { + "localId": "49", + "locator": "61:9-61:39", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Kidney Failure", + "type": "ValueSetRef" + } + } + ] + }, + { + "type": "Union", + "operand": [ + { + "localId": "51", + "locator": "62:9-62:66", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Glomerulonephritis and Nephrotic Syndrome", + "type": "ValueSetRef" + } + }, + { + "localId": "53", + "locator": "63:9-63:45", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Diabetic Nephropathy", + "type": "ValueSetRef" + } + } + ] + } + ] + }, + { + "localId": "55", + "locator": "64:9-64:36", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Proteinuria", + "type": "ValueSetRef" + } + } + ] + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "61", + "locator": "65:3-65:75", + "type": "Overlaps", + "operand": [ + { + "localId": "59", + "locator": "65:9-65:45", + "path": "prevalencePeriod", + "scope": "NephropathyDiagnoses", + "type": "Property" + }, + { + "localId": "60", + "locator": "65:56-65:75", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + }, + { + "localId": "91", + "locator": "93:1-100:3", + "name": "Initial Population", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "91", + "s": [ + { + "value": [ + "define ", + "\"Initial Population\"", + ":\n\t" + ] + }, + { + "r": "90", + "s": [ + { + "r": "81", + "s": [ + { + "r": "77", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "76", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "76", + "s": [ + { + "s": [ + { + "r": "65", + "s": [ + { + "r": "64", + "s": [ + { + "r": "64", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Birthdate\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Birth date\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "BirthDate" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "75", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "75", + "s": [ + { + "r": "71", + "s": [ + { + "r": "66", + "s": [ + { + "value": [ + "Global" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "71", + "s": [ + { + "value": [ + "\"CalendarAgeInYearsAt\"", + "(" + ] + }, + { + "r": "68", + "s": [ + { + "r": "67", + "s": [ + { + "value": [ + "BirthDate" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "68", + "s": [ + { + "value": [ + "birthDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "70", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "69", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + "in " + ] + }, + { + "r": "74", + "s": [ + { + "value": [ + "Interval[", + "18", + ", ", + "75", + " )" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tand " + ] + }, + { + "r": "80", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "79", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "79", + "s": [ + { + "r": "78", + "s": [ + { + "value": [ + "AdultOutpatientEncounters" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "79", + "s": [ + { + "value": [ + "\"Qualifying Encounters\"" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tand " + ] + }, + { + "r": "89", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "88", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "88", + "s": [ + { + "s": [ + { + "r": "83", + "s": [ + { + "r": "82", + "s": [ + { + "r": "82", + "s": [ + { + "value": [ + "[", + "\"Diagnosis\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Diabetes\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Diabetes" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "87", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "87", + "s": [ + { + "r": "85", + "s": [ + { + "r": "84", + "s": [ + { + "value": [ + "Diabetes" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "85", + "s": [ + { + "value": [ + "prevalencePeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "86", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "90", + "locator": "94:2-100:3", + "type": "And", + "operand": [ + { + "localId": "81", + "locator": "94:2-97:66", + "type": "And", + "operand": [ + { + "localId": "77", + "locator": "94:2-96:2", + "type": "Exists", + "operand": { + "localId": "76", + "locator": "94:9-96:2", + "type": "Query", + "source": [ + { + "localId": "65", + "locator": "94:11-94:70", + "alias": "BirthDate", + "expression": { + "localId": "64", + "locator": "94:11-94:60", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicBirthdate", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "type": "ToList", + "operand": { + "name": "Birth date", + "type": "CodeRef" + } + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "75", + "locator": "95:4-95:114", + "type": "In", + "operand": [ + { + "localId": "71", + "locator": "95:10-95:94", + "name": "CalendarAgeInYearsAt", + "libraryName": "Global", + "type": "FunctionRef", + "operand": [ + { + "localId": "68", + "locator": "95:40-95:62", + "path": "birthDatetime", + "scope": "BirthDate", + "type": "Property" + }, + { + "localId": "70", + "locator": "95:65-95:93", + "type": "Start", + "operand": { + "localId": "69", + "locator": "95:74-95:93", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + ] + }, + { + "localId": "74", + "locator": "95:98-95:114", + "lowClosed": true, + "highClosed": false, + "type": "Interval", + "low": { + "localId": "72", + "locator": "95:107-95:108", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "18", + "type": "Literal" + }, + "high": { + "localId": "73", + "locator": "95:111-95:112", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "75", + "type": "Literal" + } + } + ] + } + } + }, + { + "localId": "80", + "locator": "97:7-97:66", + "type": "Exists", + "operand": { + "localId": "79", + "locator": "97:14-97:66", + "name": "Qualifying Encounters", + "libraryName": "AdultOutpatientEncounters", + "type": "ExpressionRef" + } + } + ] + }, + { + "localId": "89", + "locator": "98:7-100:3", + "type": "Exists", + "operand": { + "localId": "88", + "locator": "98:14-100:3", + "type": "Query", + "source": [ + { + "localId": "83", + "locator": "98:16-98:49", + "alias": "Diabetes", + "expression": { + "localId": "82", + "locator": "98:16-98:40", + "dataType": "{urn:healthit-gov:qdm:v5_4}Diagnosis", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Diabetes", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "87", + "locator": "99:5-99:65", + "type": "Overlaps", + "operand": [ + { + "localId": "85", + "locator": "99:11-99:35", + "path": "prevalencePeriod", + "scope": "Diabetes", + "type": "Property" + }, + { + "localId": "86", + "locator": "99:46-99:65", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + } + }, + { + "localId": "93", + "locator": "67:1-68:21", + "name": "Denominator", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "93", + "s": [ + { + "value": [ + "define ", + "\"Denominator\"", + ":\n\t" + ] + }, + { + "r": "92", + "s": [ + { + "value": [ + "\"Initial Population\"" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "92", + "locator": "68:2-68:21", + "name": "Initial Population", + "type": "ExpressionRef" + } + }, + { + "localId": "100", + "locator": "70:1-72:44", + "name": "Protein Urea Lab Test", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "100", + "s": [ + { + "value": [ + "define ", + "\"Protein Urea Lab Test\"", + ":\n\t" + ] + }, + { + "r": "99", + "s": [ + { + "s": [ + { + "r": "95", + "s": [ + { + "r": "94", + "s": [ + { + "r": "94", + "s": [ + { + "value": [ + "[", + "\"Laboratory Test, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Urine Protein Tests\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "ProteinUreaResult" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "98", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "98", + "s": [ + { + "r": "97", + "s": [ + { + "r": "96", + "s": [ + { + "value": [ + "ProteinUreaResult" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "97", + "s": [ + { + "value": [ + "result" + ] + } + ] + } + ] + }, + { + "value": [ + " is not null" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "99", + "locator": "71:2-72:44", + "type": "Query", + "source": [ + { + "localId": "95", + "locator": "71:2-71:72", + "alias": "ProteinUreaResult", + "expression": { + "localId": "94", + "locator": "71:2-71:54", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveLaboratoryTestPerformed", + "templateId": "PositiveLaboratoryTestPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Urine Protein Tests", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "98", + "locator": "72:3-72:44", + "type": "Not", + "operand": { + "locator": "72:9-72:44", + "type": "IsNull", + "operand": { + "localId": "97", + "locator": "72:9-72:32", + "path": "result", + "scope": "ProteinUreaResult", + "type": "Property" + } + } + } + } + }, + { + "localId": "102", + "locator": "74:1-75:61", + "name": "End Stage Renal Disease Encounter", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "102", + "s": [ + { + "value": [ + "define ", + "\"End Stage Renal Disease Encounter\"", + ":\n\t" + ] + }, + { + "r": "101", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"ESRD Monthly Outpatient Services\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "101", + "locator": "75:2-75:61", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "ESRD Monthly Outpatient Services", + "type": "ValueSetRef" + } + } + }, + { + "localId": "110", + "locator": "82:1-84:71", + "name": "Active ACE or ARB Medications", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "110", + "s": [ + { + "value": [ + "define ", + "\"Active ACE or ARB Medications\"", + ":\n\t" + ] + }, + { + "r": "109", + "s": [ + { + "s": [ + { + "r": "104", + "s": [ + { + "r": "103", + "s": [ + { + "r": "103", + "s": [ + { + "value": [ + "[", + "\"Medication, Active\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"ACE Inhibitor or ARB\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "ACEorARBMedication" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "108", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "108", + "s": [ + { + "r": "106", + "s": [ + { + "r": "105", + "s": [ + { + "value": [ + "ACEorARBMedication" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "106", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "107", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "109", + "locator": "83:2-84:71", + "type": "Query", + "source": [ + { + "localId": "104", + "locator": "83:2-83:66", + "alias": "ACEorARBMedication", + "expression": { + "localId": "103", + "locator": "83:2-83:47", + "dataType": "{urn:healthit-gov:qdm:v5_4}MedicationActive", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "ACE Inhibitor or ARB", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "108", + "locator": "84:3-84:71", + "type": "Overlaps", + "operand": [ + { + "localId": "106", + "locator": "84:9-84:41", + "path": "relevantPeriod", + "scope": "ACEorARBMedication", + "type": "Property" + }, + { + "localId": "107", + "locator": "84:52-84:71", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + }, + { + "localId": "129", + "locator": "86:1-91:71", + "name": "Nephropathy Screenings", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "129", + "s": [ + { + "value": [ + "define ", + "\"Nephropathy Screenings\"", + ":\n\t" + ] + }, + { + "r": "128", + "s": [ + { + "s": [ + { + "r": "123", + "s": [ + { + "r": "122", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "122", + "s": [ + { + "r": "120", + "s": [ + { + "r": "118", + "s": [ + { + "r": "116", + "s": [ + { + "value": [ + "\"Renal Procedures\"" + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "117", + "s": [ + { + "value": [ + "\"Renal Interventions\"" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "119", + "s": [ + { + "value": [ + "\"End Stage Renal Disease Encounter\"" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tunion " + ] + }, + { + "r": "121", + "s": [ + { + "value": [ + "\"Protein Urea Lab Test\"" + ] + } + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + " ", + "ScreeningNephropathy" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "127", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "127", + "s": [ + { + "r": "125", + "s": [ + { + "r": "124", + "s": [ + { + "value": [ + "ScreeningNephropathy" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "125", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "during", + " " + ] + }, + { + "r": "126", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "128", + "locator": "87:2-91:71", + "type": "Query", + "source": [ + { + "localId": "123", + "locator": "87:2-90:54", + "alias": "ScreeningNephropathy", + "expression": { + "localId": "122", + "locator": "87:2-90:33", + "type": "Union", + "operand": [ + { + "type": "As", + "operand": { + "localId": "120", + "locator": "87:4-89:43", + "type": "Union", + "operand": [ + { + "type": "As", + "operand": { + "localId": "118", + "locator": "87:4-88:29", + "type": "Union", + "operand": [ + { + "type": "As", + "operand": { + "localId": "116", + "locator": "87:4-87:21", + "name": "Renal Procedures", + "type": "ExpressionRef" + }, + "asTypeSpecifier": { + "type": "ListTypeSpecifier", + "elementType": { + "type": [ + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "type": "NamedTypeSpecifier" + } + ] + } + } + }, + { + "type": "As", + "operand": { + "localId": "117", + "locator": "88:9-88:29", + "name": "Renal Interventions", + "type": "ExpressionRef" + }, + "asTypeSpecifier": { + "type": "ListTypeSpecifier", + "elementType": { + "type": [ + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "type": "NamedTypeSpecifier" + } + ] + } + } + } + ] + }, + "asTypeSpecifier": { + "type": "ListTypeSpecifier", + "elementType": { + "type": [ + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "type": "NamedTypeSpecifier" + } + ] + } + } + }, + { + "type": "As", + "operand": { + "localId": "119", + "locator": "89:9-89:43", + "name": "End Stage Renal Disease Encounter", + "type": "ExpressionRef" + }, + "asTypeSpecifier": { + "type": "ListTypeSpecifier", + "elementType": { + "type": [ + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "type": "NamedTypeSpecifier" + } + ] + } + } + } + ] + }, + "asTypeSpecifier": { + "type": "ListTypeSpecifier", + "elementType": { + "type": [ + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveLaboratoryTestPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "type": "NamedTypeSpecifier" + } + ] + } + } + }, + { + "type": "As", + "operand": { + "localId": "121", + "locator": "90:9-90:31", + "name": "Protein Urea Lab Test", + "type": "ExpressionRef" + }, + "asTypeSpecifier": { + "type": "ListTypeSpecifier", + "elementType": { + "type": [ + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveLaboratoryTestPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "type": "NamedTypeSpecifier" + }, + { + "name": "{urn:healthit-gov:qdm:v5_4}PositiveProcedurePerformed", + "type": "NamedTypeSpecifier" + } + ] + } + } + } + ] + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "127", + "locator": "91:3-91:71", + "type": "IncludedIn", + "operand": [ + { + "localId": "125", + "locator": "91:9-91:43", + "path": "relevantPeriod", + "scope": "ScreeningNephropathy", + "type": "Property" + }, + { + "localId": "126", + "locator": "91:52-91:71", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + }, + { + "localId": "133", + "locator": "77:1-80:40", + "name": "Numerator", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "133", + "s": [ + { + "value": [ + "define ", + "\"Numerator\"", + ":\n\t" + ] + }, + { + "r": "132", + "s": [ + { + "r": "115", + "s": [ + { + "r": "112", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "111", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "111", + "s": [ + { + "value": [ + "\"Active ACE or ARB Medications\"" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "114", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "113", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "113", + "s": [ + { + "value": [ + "\"Nephropathy Diagnoses\"" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "131", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "130", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "130", + "s": [ + { + "value": [ + "\"Nephropathy Screenings\"" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "132", + "locator": "78:2-80:40", + "type": "Or", + "operand": [ + { + "localId": "115", + "locator": "78:2-79:39", + "type": "Or", + "operand": [ + { + "localId": "112", + "locator": "78:2-78:43", + "type": "Exists", + "operand": { + "localId": "111", + "locator": "78:9-78:43", + "name": "Active ACE or ARB Medications", + "type": "ExpressionRef" + } + }, + { + "localId": "114", + "locator": "79:6-79:39", + "type": "Exists", + "operand": { + "localId": "113", + "locator": "79:13-79:39", + "name": "Nephropathy Diagnoses", + "type": "ExpressionRef" + } + } + ] + }, + { + "localId": "131", + "locator": "80:6-80:40", + "type": "Exists", + "operand": { + "localId": "130", + "locator": "80:13-80:40", + "name": "Nephropathy Screenings", + "type": "ExpressionRef" + } + } + ] + } + }, + { + "localId": "155", + "locator": "102:1-108:26", + "name": "Denominator Exclusions", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "155", + "s": [ + { + "value": [ + "define ", + "\"Denominator Exclusions\"", + ":\n\t" + ] + }, + { + "r": "154", + "s": [ + { + "r": "151", + "s": [ + { + "r": "148", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "147", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "147", + "s": [ + { + "s": [ + { + "r": "135", + "s": [ + { + "r": "134", + "s": [ + { + "r": "134", + "s": [ + { + "value": [ + "[", + "\"Patient Characteristic Birthdate\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Birth date\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "BirthDate" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "146", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "146", + "s": [ + { + "r": "143", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "143", + "s": [ + { + "r": "141", + "s": [ + { + "r": "136", + "s": [ + { + "value": [ + "Global" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "141", + "s": [ + { + "value": [ + "\"CalendarAgeInYearsAt\"", + "(" + ] + }, + { + "r": "138", + "s": [ + { + "r": "137", + "s": [ + { + "value": [ + "BirthDate" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "138", + "s": [ + { + "value": [ + "birthDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "140", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "139", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + ">=", + " ", + "65" + ] + } + ] + }, + { + "value": [ + " )" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "145", + "s": [ + { + "r": "144", + "s": [ + { + "value": [ + "FrailtyLTI" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "145", + "s": [ + { + "value": [ + "\"Has Spent More Than 90 Days in Long Term Care\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "150", + "s": [ + { + "r": "149", + "s": [ + { + "value": [ + "FrailtyLTI" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "150", + "s": [ + { + "value": [ + "\"Advanced Illness and Frailty Exclusion Including Under Age 80\"" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "153", + "s": [ + { + "r": "152", + "s": [ + { + "value": [ + "Hospice" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "153", + "s": [ + { + "value": [ + "\"Has Hospice\"" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "154", + "locator": "103:2-108:26", + "type": "Or", + "operand": [ + { + "localId": "151", + "locator": "103:2-107:79", + "type": "Or", + "operand": [ + { + "localId": "148", + "locator": "103:2-106:2", + "type": "Exists", + "operand": { + "localId": "147", + "locator": "103:9-106:2", + "type": "Query", + "source": [ + { + "localId": "135", + "locator": "103:11-103:70", + "alias": "BirthDate", + "expression": { + "localId": "134", + "locator": "103:11-103:60", + "dataType": "{urn:healthit-gov:qdm:v5_4}PatientCharacteristicBirthdate", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "type": "ToList", + "operand": { + "name": "Birth date", + "type": "CodeRef" + } + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "146", + "locator": "104:4-105:66", + "type": "And", + "operand": [ + { + "localId": "143", + "locator": "104:10-104:103", + "type": "GreaterOrEqual", + "operand": [ + { + "localId": "141", + "locator": "104:12-104:96", + "name": "CalendarAgeInYearsAt", + "libraryName": "Global", + "type": "FunctionRef", + "operand": [ + { + "localId": "138", + "locator": "104:42-104:64", + "path": "birthDatetime", + "scope": "BirthDate", + "type": "Property" + }, + { + "localId": "140", + "locator": "104:67-104:95", + "type": "Start", + "operand": { + "localId": "139", + "locator": "104:76-104:95", + "name": "Measurement Period", + "type": "ParameterRef" + } + } + ] + }, + { + "localId": "142", + "locator": "104:100-104:101", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "65", + "type": "Literal" + } + ] + }, + { + "localId": "145", + "locator": "105:9-105:66", + "name": "Has Spent More Than 90 Days in Long Term Care", + "libraryName": "FrailtyLTI", + "type": "ExpressionRef" + } + ] + } + } + }, + { + "localId": "150", + "locator": "107:6-107:79", + "name": "Advanced Illness and Frailty Exclusion Including Under Age 80", + "libraryName": "FrailtyLTI", + "type": "ExpressionRef" + } + ] + }, + { + "localId": "153", + "locator": "108:6-108:26", + "name": "Has Hospice", + "libraryName": "Hospice", + "type": "ExpressionRef" + } + ] + } + } + ] + } + } + }, + "elm_annotations": { + "statements": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"SDE Ethnicity\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Ethnicity\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Ethnicity\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "30" + } + ], + "ref_id": "31" + } + ], + "define_name": "SDE Ethnicity" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"SDE Payer\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Payer\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Payer\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "32" + } + ], + "ref_id": "33" + } + ], + "define_name": "SDE Payer" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"SDE Race\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Race\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Race\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "34" + } + ], + "ref_id": "35" + } + ], + "define_name": "SDE Race" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"SDE Sex\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Sex\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"ONC Administrative Sex\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "36" + } + ], + "ref_id": "37" + } + ], + "define_name": "SDE Sex" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Renal Procedures\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Procedure, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Kidney Transplant\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "38" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Procedure, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Vascular Access for Dialysis\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "39" + } + ], + "node_type": "Union", + "ref_id": "40" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Procedure, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Dialysis Services\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "41" + } + ], + "node_type": "Union", + "ref_id": "42" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Union", + "ref_id": "42" + } + ], + "ref_id": "43" + } + ], + "define_name": "Renal Procedures" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Renal Interventions\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Intervention, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Other Services Related to Dialysis\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "44" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Intervention, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Dialysis Education\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "45" + } + ], + "node_type": "Union", + "ref_id": "46" + } + ], + "ref_id": "47" + } + ], + "define_name": "Renal Interventions" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Nephropathy Diagnoses\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Hypertensive Chronic Kidney Disease\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "48" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Kidney Failure\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "49" + } + ], + "node_type": "Union", + "ref_id": "50" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Glomerulonephritis and Nephrotic Syndrome\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "51" + } + ], + "ref_id": "52" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Diabetic Nephropathy\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "53" + } + ], + "node_type": "Union", + "ref_id": "54" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Proteinuria\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "55" + } + ], + "node_type": "Union", + "ref_id": "56" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "Union", + "ref_id": "56" + }, + { + "children": [ + { + "text": " NephropathyDiagnoses" + } + ] + } + ], + "ref_id": "57" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "NephropathyDiagnoses" + } + ] + } + ], + "ref_id": "58" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "prevalencePeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "59" + } + ], + "node_type": "Property", + "ref_id": "59" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "60" + } + ], + "ref_id": "61" + } + ], + "ref_id": "61" + } + ], + "node_type": "Query", + "ref_id": "62" + } + ], + "ref_id": "63" + } + ], + "define_name": "Nephropathy Diagnoses" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Initial Population\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Birthdate\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Birth date\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "64" + } + ], + "node_type": "Retrieve", + "ref_id": "64" + }, + { + "children": [ + { + "text": " BirthDate" + } + ] + } + ], + "ref_id": "65" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Global" + } + ] + } + ], + "ref_id": "66" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"CalendarAgeInYearsAt\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "BirthDate" + } + ] + } + ], + "ref_id": "67" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "birthDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "68" + } + ], + "node_type": "Property", + "ref_id": "68" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "69" + } + ], + "node_type": "Start", + "ref_id": "70" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "71" + } + ], + "node_type": "FunctionRef", + "ref_id": "71" + }, + { + "children": [ + { + "text": "in " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval[18, 75 )" + } + ] + } + ], + "node_type": "Interval", + "ref_id": "74" + } + ], + "ref_id": "75" + } + ], + "ref_id": "75" + } + ], + "node_type": "Query", + "ref_id": "76" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "76" + } + ], + "node_type": "Exists", + "ref_id": "77" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "AdultOutpatientEncounters" + } + ] + } + ], + "ref_id": "78" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Qualifying Encounters\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "79" + } + ], + "node_type": "ExpressionRef", + "ref_id": "79" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "79" + } + ], + "node_type": "Exists", + "ref_id": "80" + } + ], + "node_type": "And", + "ref_id": "81" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Diagnosis\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Diabetes\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "82" + } + ], + "node_type": "Retrieve", + "ref_id": "82" + }, + { + "children": [ + { + "text": " Diabetes" + } + ] + } + ], + "ref_id": "83" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Diabetes" + } + ] + } + ], + "ref_id": "84" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "prevalencePeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "85" + } + ], + "node_type": "Property", + "ref_id": "85" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "86" + } + ], + "ref_id": "87" + } + ], + "ref_id": "87" + } + ], + "node_type": "Query", + "ref_id": "88" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "88" + } + ], + "node_type": "Exists", + "ref_id": "89" + } + ], + "node_type": "And", + "ref_id": "90" + } + ], + "ref_id": "91" + } + ], + "define_name": "Initial Population" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Denominator\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Initial Population\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "92" + } + ], + "ref_id": "93" + } + ], + "define_name": "Denominator" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Protein Urea Lab Test\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Laboratory Test, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Urine Protein Tests\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "94" + } + ], + "node_type": "Retrieve", + "ref_id": "94" + }, + { + "children": [ + { + "text": " ProteinUreaResult" + } + ] + } + ], + "ref_id": "95" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "ProteinUreaResult" + } + ] + } + ], + "ref_id": "96" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "result" + } + ] + } + ], + "node_type": "Property", + "ref_id": "97" + } + ], + "node_type": "Property", + "ref_id": "97" + }, + { + "children": [ + { + "text": " is not null" + } + ] + } + ], + "ref_id": "98" + } + ], + "ref_id": "98" + } + ], + "node_type": "Query", + "ref_id": "99" + } + ], + "ref_id": "100" + } + ], + "define_name": "Protein Urea Lab Test" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"End Stage Renal Disease Encounter\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"ESRD Monthly Outpatient Services\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "101" + } + ], + "ref_id": "102" + } + ], + "define_name": "End Stage Renal Disease Encounter" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Active ACE or ARB Medications\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Medication, Active\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"ACE Inhibitor or ARB\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "103" + } + ], + "node_type": "Retrieve", + "ref_id": "103" + }, + { + "children": [ + { + "text": " ACEorARBMedication" + } + ] + } + ], + "ref_id": "104" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "ACEorARBMedication" + } + ] + } + ], + "ref_id": "105" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "106" + } + ], + "node_type": "Property", + "ref_id": "106" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "107" + } + ], + "ref_id": "108" + } + ], + "ref_id": "108" + } + ], + "node_type": "Query", + "ref_id": "109" + } + ], + "ref_id": "110" + } + ], + "define_name": "Active ACE or ARB Medications" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Nephropathy Screenings\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "\"Renal Procedures\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "116" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Renal Interventions\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "117" + } + ], + "node_type": "Union", + "ref_id": "118" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"End Stage Renal Disease Encounter\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "119" + } + ], + "node_type": "Union", + "ref_id": "120" + }, + { + "children": [ + { + "text": "\n union " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Protein Urea Lab Test\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "121" + } + ], + "node_type": "Union", + "ref_id": "122" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "Union", + "ref_id": "122" + }, + { + "children": [ + { + "text": " ScreeningNephropathy" + } + ] + } + ], + "ref_id": "123" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "ScreeningNephropathy" + } + ] + } + ], + "ref_id": "124" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "125" + } + ], + "node_type": "Property", + "ref_id": "125" + }, + { + "children": [ + { + "text": " during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "126" + } + ], + "ref_id": "127" + } + ], + "ref_id": "127" + } + ], + "node_type": "Query", + "ref_id": "128" + } + ], + "ref_id": "129" + } + ], + "define_name": "Nephropathy Screenings" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Numerator\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Active ACE or ARB Medications\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "111" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "111" + } + ], + "node_type": "Exists", + "ref_id": "112" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Nephropathy Diagnoses\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "113" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "113" + } + ], + "node_type": "Exists", + "ref_id": "114" + } + ], + "node_type": "Or", + "ref_id": "115" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Nephropathy Screenings\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "130" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "130" + } + ], + "node_type": "Exists", + "ref_id": "131" + } + ], + "node_type": "Or", + "ref_id": "132" + } + ], + "ref_id": "133" + } + ], + "define_name": "Numerator" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Denominator Exclusions\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Patient Characteristic Birthdate\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Birth date\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "134" + } + ], + "node_type": "Retrieve", + "ref_id": "134" + }, + { + "children": [ + { + "text": " BirthDate" + } + ] + } + ], + "ref_id": "135" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Global" + } + ] + } + ], + "ref_id": "136" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"CalendarAgeInYearsAt\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "BirthDate" + } + ] + } + ], + "ref_id": "137" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "birthDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "138" + } + ], + "node_type": "Property", + "ref_id": "138" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "139" + } + ], + "node_type": "Start", + "ref_id": "140" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "141" + } + ], + "node_type": "FunctionRef", + "ref_id": "141" + }, + { + "children": [ + { + "text": ">= 65" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "143" + }, + { + "children": [ + { + "text": " )" + } + ] + } + ], + "node_type": "GreaterOrEqual", + "ref_id": "143" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtyLTI" + } + ] + } + ], + "ref_id": "144" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Has Spent More Than 90 Days in Long Term Care\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "145" + } + ], + "node_type": "ExpressionRef", + "ref_id": "145" + } + ], + "ref_id": "146" + } + ], + "ref_id": "146" + } + ], + "node_type": "Query", + "ref_id": "147" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "147" + } + ], + "node_type": "Exists", + "ref_id": "148" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "FrailtyLTI" + } + ] + } + ], + "ref_id": "149" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Advanced Illness and Frailty Exclusion Including Under Age 80\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "150" + } + ], + "node_type": "ExpressionRef", + "ref_id": "150" + } + ], + "node_type": "Or", + "ref_id": "151" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Hospice" + } + ] + } + ], + "ref_id": "152" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Has Hospice\"" + } + ] + } + ], + "node_type": "ExpressionRef", + "ref_id": "153" + } + ], + "node_type": "ExpressionRef", + "ref_id": "153" + } + ], + "node_type": "Or", + "ref_id": "154" + } + ], + "ref_id": "155" + } + ], + "define_name": "Denominator Exclusions" + } + ], + "identifier": { + "id": "DiabetesMedicalAttentionforNephropathy", + "version": "8.4.000" + } + }, + "is_main_library": true, + "is_top_level": true, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "library_version": "8.4.000", + "statement_dependencies": [ + { + "_id": "6500d365e77bbf53b55d21a0", + "statement_name": "Patient" + }, + { + "_id": "6500d365e77bbf53b55d21a1", + "statement_name": "SDE Ethnicity" + }, + { + "_id": "6500d365e77bbf53b55d21a2", + "statement_name": "SDE Payer" + }, + { + "_id": "6500d365e77bbf53b55d21a3", + "statement_name": "SDE Race" + }, + { + "_id": "6500d365e77bbf53b55d21a4", + "statement_name": "SDE Sex" + }, + { + "_id": "6500d365e77bbf53b55d21a5", + "statement_name": "Renal Procedures" + }, + { + "_id": "6500d365e77bbf53b55d21a6", + "statement_name": "Renal Interventions" + }, + { + "_id": "6500d365e77bbf53b55d21a7", + "statement_name": "Nephropathy Diagnoses" + }, + { + "_id": "6500d365e77bbf53b55d21a8", + "statement_name": "Initial Population", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d21a9", + "hqmf_id": null, + "library_name": "MATGlobalCommonFunctions", + "statement_name": "CalendarAgeInYearsAt" + }, + { + "_id": "6500d365e77bbf53b55d21aa", + "hqmf_id": null, + "library_name": "Adult_Outpatient_Encounters", + "statement_name": "Qualifying Encounters" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21ab", + "statement_name": "Denominator", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d21ac", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Initial Population" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21ad", + "statement_name": "Protein Urea Lab Test" + }, + { + "_id": "6500d365e77bbf53b55d21ae", + "statement_name": "End Stage Renal Disease Encounter" + }, + { + "_id": "6500d365e77bbf53b55d21af", + "statement_name": "Active ACE or ARB Medications" + }, + { + "_id": "6500d365e77bbf53b55d21b0", + "statement_name": "Nephropathy Screenings", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d21b1", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Renal Procedures" + }, + { + "_id": "6500d365e77bbf53b55d21b2", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Renal Interventions" + }, + { + "_id": "6500d365e77bbf53b55d21b3", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "End Stage Renal Disease Encounter" + }, + { + "_id": "6500d365e77bbf53b55d21b4", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Protein Urea Lab Test" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21b5", + "statement_name": "Numerator", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d21b6", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Active ACE or ARB Medications" + }, + { + "_id": "6500d365e77bbf53b55d21b7", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Nephropathy Diagnoses" + }, + { + "_id": "6500d365e77bbf53b55d21b8", + "hqmf_id": null, + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Nephropathy Screenings" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21b9", + "statement_name": "Denominator Exclusions", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d21ba", + "hqmf_id": null, + "library_name": "MATGlobalCommonFunctions", + "statement_name": "CalendarAgeInYearsAt" + }, + { + "_id": "6500d365e77bbf53b55d21bb", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Has Spent More Than 90 Days in Long Term Care" + }, + { + "_id": "6500d365e77bbf53b55d21bc", + "hqmf_id": null, + "library_name": "AdvancedIllnessandFrailtyExclusionECQM", + "statement_name": "Advanced Illness and Frailty Exclusion Including Under Age 80" + }, + { + "_id": "6500d365e77bbf53b55d21bd", + "hqmf_id": null, + "library_name": "Hospice", + "statement_name": "Has Hospice" + } + ] + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21be", + "cql": "library Hospice version '2.0.000'\n\nusing QDM version '5.4'\n\ncodesystem \"SNOMEDCT\": 'urn:oid:2.16.840.1.113883.6.96' \n\nvalueset \"Encounter Inpatient\": 'urn:oid:2.16.840.1.113883.3.666.5.307' \nvalueset \"Hospice care ambulatory\": 'urn:oid:2.16.840.1.113762.1.4.1108.15' \n\ncode \"Discharge to healthcare facility for hospice care (procedure)\": '428371000124100' from \"SNOMEDCT\" display 'Discharge to healthcare facility for hospice care (procedure)'\ncode \"Discharge to home for hospice care (procedure)\": '428361000124107' from \"SNOMEDCT\" display 'Discharge to home for hospice care (procedure)'\n\nparameter \"Measurement Period\" Interval\n\ncontext Patient\n\ndefine \"Has Hospice\":\n\texists ( [\"Encounter, Performed\": \"Encounter Inpatient\"] DischargeHospice\n\t\t\twhere ( DischargeHospice.dischargeDisposition as Code ~ \"Discharge to home for hospice care (procedure)\"\n\t\t\t\t\tor DischargeHospice.dischargeDisposition as Code ~ \"Discharge to healthcare facility for hospice care (procedure)\"\n\t\t\t)\n\t\t\t\tand DischargeHospice.relevantPeriod ends during \"Measurement Period\"\n\t)\n\t\tor exists ( [\"Intervention, Order\": \"Hospice care ambulatory\"] HospiceOrder\n\t\t\t\twhere HospiceOrder.authorDatetime during \"Measurement Period\"\n\t\t)\n\t\tor exists ( [\"Intervention, Performed\": \"Hospice care ambulatory\"] HospicePerformed\n\t\t\t\twhere HospicePerformed.relevantPeriod overlaps \"Measurement Period\"\n\t\t)\n\n", + "elm": { + "library": { + "identifier": { + "id": "Hospice", + "version": "2.0.000" + }, + "schemaIdentifier": { + "id": "urn:hl7-org:elm", + "version": "r1" + }, + "usings": { + "def": [ + { + "localIdentifier": "System", + "uri": "urn:hl7-org:elm-types:r1" + }, + { + "localId": "1", + "locator": "3:1-3:23", + "localIdentifier": "QDM", + "uri": "urn:healthit-gov:qdm:v5_4", + "version": "5.4" + } + ] + }, + "parameters": { + "def": [ + { + "localId": "11", + "locator": "13:1-13:49", + "name": "Measurement Period", + "accessLevel": "Public", + "parameterTypeSpecifier": { + "localId": "10", + "locator": "13:32-13:49", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "9", + "locator": "13:41-13:48", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + ] + }, + "codeSystems": { + "def": [ + { + "localId": "2", + "locator": "5:1-5:55", + "name": "SNOMEDCT", + "id": "2.16.840.1.113883.6.96", + "accessLevel": "Public" + } + ] + }, + "valueSets": { + "def": [ + { + "localId": "3", + "locator": "7:1-7:71", + "name": "Encounter Inpatient", + "id": "2.16.840.1.113883.3.666.5.307", + "accessLevel": "Public" + }, + { + "localId": "4", + "locator": "8:1-8:75", + "name": "Hospice care ambulatory", + "id": "2.16.840.1.113762.1.4.1108.15", + "accessLevel": "Public" + } + ] + }, + "codes": { + "def": [ + { + "localId": "6", + "locator": "10:1-10:175", + "name": "Discharge to healthcare facility for hospice care (procedure)", + "id": "428371000124100", + "display": "Discharge to healthcare facility for hospice care (procedure)", + "accessLevel": "Public", + "codeSystem": { + "localId": "5", + "locator": "10:94-10:103", + "name": "SNOMEDCT" + } + }, + { + "localId": "8", + "locator": "11:1-11:145", + "name": "Discharge to home for hospice care (procedure)", + "id": "428361000124107", + "display": "Discharge to home for hospice care (procedure)", + "accessLevel": "Public", + "codeSystem": { + "localId": "7", + "locator": "11:79-11:88", + "name": "SNOMEDCT" + } + } + ] + }, + "statements": { + "def": [ + { + "locator": "15:1-15:15", + "name": "Patient", + "context": "Patient", + "expression": { + "type": "SingletonFrom", + "operand": { + "locator": "15:1-15:15", + "dataType": "{urn:healthit-gov:qdm:v5_4}Patient", + "templateId": "Patient", + "type": "Retrieve" + } + } + }, + { + "localId": "52", + "locator": "17:1-29:3", + "name": "Has Hospice", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "52", + "s": [ + { + "value": [ + "define ", + "\"Has Hospice\"", + ":\n\t" + ] + }, + { + "r": "51", + "s": [ + { + "r": "42", + "s": [ + { + "r": "33", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "32", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "32", + "s": [ + { + "s": [ + { + "r": "13", + "s": [ + { + "r": "12", + "s": [ + { + "r": "12", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Encounter Inpatient\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "DischargeHospice" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "31", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "31", + "s": [ + { + "r": "26", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "26", + "s": [ + { + "r": "19", + "s": [ + { + "r": "17", + "s": [ + { + "r": "15", + "s": [ + { + "r": "14", + "s": [ + { + "value": [ + "DischargeHospice" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "15", + "s": [ + { + "value": [ + "dischargeDisposition" + ] + } + ] + } + ] + }, + { + "value": [ + " as " + ] + }, + { + "r": "16", + "s": [ + { + "value": [ + "Code" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "~", + " " + ] + }, + { + "r": "18", + "s": [ + { + "value": [ + "\"Discharge to home for hospice care (procedure)\"" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t\tor " + ] + }, + { + "r": "25", + "s": [ + { + "r": "23", + "s": [ + { + "r": "21", + "s": [ + { + "r": "20", + "s": [ + { + "value": [ + "DischargeHospice" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "21", + "s": [ + { + "value": [ + "dischargeDisposition" + ] + } + ] + } + ] + }, + { + "value": [ + " as " + ] + }, + { + "r": "22", + "s": [ + { + "value": [ + "Code" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "~", + " " + ] + }, + { + "r": "24", + "s": [ + { + "value": [ + "\"Discharge to healthcare facility for hospice care (procedure)\"" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t)" + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "30", + "s": [ + { + "r": "28", + "s": [ + { + "r": "27", + "s": [ + { + "value": [ + "DischargeHospice" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "28", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "ends during", + " " + ] + }, + { + "r": "29", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "41", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "40", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "40", + "s": [ + { + "s": [ + { + "r": "35", + "s": [ + { + "r": "34", + "s": [ + { + "r": "34", + "s": [ + { + "value": [ + "[", + "\"Intervention, Order\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Hospice care ambulatory\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "HospiceOrder" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "39", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "39", + "s": [ + { + "r": "37", + "s": [ + { + "r": "36", + "s": [ + { + "value": [ + "HospiceOrder" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "37", + "s": [ + { + "value": [ + "authorDatetime" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "during", + " " + ] + }, + { + "r": "38", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\tor " + ] + }, + { + "r": "50", + "s": [ + { + "value": [ + "exists " + ] + }, + { + "r": "49", + "s": [ + { + "value": [ + "( " + ] + }, + { + "r": "49", + "s": [ + { + "s": [ + { + "r": "44", + "s": [ + { + "r": "43", + "s": [ + { + "r": "43", + "s": [ + { + "value": [ + "[", + "\"Intervention, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Hospice care ambulatory\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "HospicePerformed" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "48", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "48", + "s": [ + { + "r": "46", + "s": [ + { + "r": "45", + "s": [ + { + "value": [ + "HospicePerformed" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "46", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "overlaps", + " " + ] + }, + { + "r": "47", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "51", + "locator": "18:2-29:3", + "type": "Or", + "operand": [ + { + "localId": "42", + "locator": "18:2-26:3", + "type": "Or", + "operand": [ + { + "localId": "33", + "locator": "18:2-23:2", + "type": "Exists", + "operand": { + "localId": "32", + "locator": "18:9-23:2", + "type": "Query", + "source": [ + { + "localId": "13", + "locator": "18:11-18:74", + "alias": "DischargeHospice", + "expression": { + "localId": "12", + "locator": "18:11-18:57", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Encounter Inpatient", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "31", + "locator": "19:4-22:72", + "type": "And", + "operand": [ + { + "localId": "26", + "locator": "19:10-21:4", + "type": "Or", + "operand": [ + { + "localId": "19", + "locator": "19:12-19:107", + "type": "Equivalent", + "operand": [ + { + "localId": "17", + "locator": "19:12-19:56", + "strict": false, + "type": "As", + "operand": { + "localId": "15", + "locator": "19:12-19:48", + "path": "dischargeDisposition", + "scope": "DischargeHospice", + "type": "Property" + }, + "asTypeSpecifier": { + "localId": "16", + "locator": "19:53-19:56", + "name": "{urn:hl7-org:elm-types:r1}Code", + "type": "NamedTypeSpecifier" + } + }, + { + "localId": "18", + "locator": "19:60-19:107", + "name": "Discharge to home for hospice care (procedure)", + "type": "CodeRef" + } + ] + }, + { + "localId": "25", + "locator": "20:9-20:119", + "type": "Equivalent", + "operand": [ + { + "localId": "23", + "locator": "20:9-20:53", + "strict": false, + "type": "As", + "operand": { + "localId": "21", + "locator": "20:9-20:45", + "path": "dischargeDisposition", + "scope": "DischargeHospice", + "type": "Property" + }, + "asTypeSpecifier": { + "localId": "22", + "locator": "20:50-20:53", + "name": "{urn:hl7-org:elm-types:r1}Code", + "type": "NamedTypeSpecifier" + } + }, + { + "localId": "24", + "locator": "20:57-20:119", + "name": "Discharge to healthcare facility for hospice care (procedure)", + "type": "CodeRef" + } + ] + } + ] + }, + { + "localId": "30", + "locator": "22:9-22:72", + "type": "In", + "operand": [ + { + "locator": "22:41-22:44", + "type": "End", + "operand": { + "localId": "28", + "locator": "22:9-22:39", + "path": "relevantPeriod", + "scope": "DischargeHospice", + "type": "Property" + } + }, + { + "localId": "29", + "locator": "22:53-22:72", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + ] + } + } + }, + { + "localId": "41", + "locator": "24:6-26:3", + "type": "Exists", + "operand": { + "localId": "40", + "locator": "24:13-26:3", + "type": "Query", + "source": [ + { + "localId": "35", + "locator": "24:15-24:77", + "alias": "HospiceOrder", + "expression": { + "localId": "34", + "locator": "24:15-24:64", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionOrder", + "templateId": "PositiveInterventionOrder", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Hospice care ambulatory", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "39", + "locator": "25:5-25:65", + "type": "In", + "operand": [ + { + "localId": "37", + "locator": "25:11-25:37", + "path": "authorDatetime", + "scope": "HospiceOrder", + "type": "Property" + }, + { + "localId": "38", + "locator": "25:46-25:65", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + }, + { + "localId": "50", + "locator": "27:6-29:3", + "type": "Exists", + "operand": { + "localId": "49", + "locator": "27:13-29:3", + "type": "Query", + "source": [ + { + "localId": "44", + "locator": "27:15-27:85", + "alias": "HospicePerformed", + "expression": { + "localId": "43", + "locator": "27:15-27:68", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveInterventionPerformed", + "templateId": "PositiveInterventionPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Hospice care ambulatory", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "48", + "locator": "28:5-28:71", + "type": "Overlaps", + "operand": [ + { + "localId": "46", + "locator": "28:11-28:41", + "path": "relevantPeriod", + "scope": "HospicePerformed", + "type": "Property" + }, + { + "localId": "47", + "locator": "28:52-28:71", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + } + } + ] + } + } + ] + } + } + }, + "elm_annotations": { + "statements": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Has Hospice\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter Inpatient\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "12" + } + ], + "node_type": "Retrieve", + "ref_id": "12" + }, + { + "children": [ + { + "text": " DischargeHospice" + } + ] + } + ], + "ref_id": "13" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "DischargeHospice" + } + ] + } + ], + "ref_id": "14" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "dischargeDisposition" + } + ] + } + ], + "node_type": "Property", + "ref_id": "15" + } + ], + "node_type": "Property", + "ref_id": "15" + }, + { + "children": [ + { + "text": " as " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Code" + } + ] + } + ], + "ref_id": "16" + } + ], + "node_type": "As", + "ref_id": "17" + }, + { + "children": [ + { + "text": " ~ " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Discharge to home for hospice care (procedure)\"" + } + ] + } + ], + "node_type": "CodeRef", + "ref_id": "18" + } + ], + "node_type": "Equivalent", + "ref_id": "19" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "DischargeHospice" + } + ] + } + ], + "ref_id": "20" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "dischargeDisposition" + } + ] + } + ], + "node_type": "Property", + "ref_id": "21" + } + ], + "node_type": "Property", + "ref_id": "21" + }, + { + "children": [ + { + "text": " as " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Code" + } + ] + } + ], + "ref_id": "22" + } + ], + "node_type": "As", + "ref_id": "23" + }, + { + "children": [ + { + "text": " ~ " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Discharge to healthcare facility for hospice care (procedure)\"" + } + ] + } + ], + "node_type": "CodeRef", + "ref_id": "24" + } + ], + "node_type": "Equivalent", + "ref_id": "25" + } + ], + "node_type": "Or", + "ref_id": "26" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Or", + "ref_id": "26" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "DischargeHospice" + } + ] + } + ], + "ref_id": "27" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "28" + } + ], + "node_type": "Property", + "ref_id": "28" + }, + { + "children": [ + { + "text": " ends during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "29" + } + ], + "node_type": "In", + "ref_id": "30" + } + ], + "ref_id": "31" + } + ], + "ref_id": "31" + } + ], + "node_type": "Query", + "ref_id": "32" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "32" + } + ], + "node_type": "Exists", + "ref_id": "33" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Intervention, Order\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Hospice care ambulatory\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "34" + } + ], + "node_type": "Retrieve", + "ref_id": "34" + }, + { + "children": [ + { + "text": " HospiceOrder" + } + ] + } + ], + "ref_id": "35" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "HospiceOrder" + } + ] + } + ], + "ref_id": "36" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "authorDatetime" + } + ] + } + ], + "node_type": "Property", + "ref_id": "37" + } + ], + "node_type": "Property", + "ref_id": "37" + }, + { + "children": [ + { + "text": " during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "38" + } + ], + "ref_id": "39" + } + ], + "ref_id": "39" + } + ], + "node_type": "Query", + "ref_id": "40" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "40" + } + ], + "node_type": "Exists", + "ref_id": "41" + } + ], + "node_type": "Or", + "ref_id": "42" + }, + { + "children": [ + { + "text": "\n or " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "exists " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "( " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Intervention, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Hospice care ambulatory\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "43" + } + ], + "node_type": "Retrieve", + "ref_id": "43" + }, + { + "children": [ + { + "text": " HospicePerformed" + } + ] + } + ], + "ref_id": "44" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "HospicePerformed" + } + ] + } + ], + "ref_id": "45" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "46" + } + ], + "node_type": "Property", + "ref_id": "46" + }, + { + "children": [ + { + "text": " overlaps " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "47" + } + ], + "ref_id": "48" + } + ], + "ref_id": "48" + } + ], + "node_type": "Query", + "ref_id": "49" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Query", + "ref_id": "49" + } + ], + "node_type": "Exists", + "ref_id": "50" + } + ], + "node_type": "Or", + "ref_id": "51" + } + ], + "ref_id": "52" + } + ], + "define_name": "Has Hospice" + } + ], + "identifier": { + "id": "Hospice", + "version": "2.0.000" + } + }, + "is_main_library": false, + "is_top_level": true, + "library_name": "Hospice", + "library_version": "2.0.000", + "statement_dependencies": [ + { + "_id": "6500d365e77bbf53b55d21bf", + "statement_name": "Has Hospice" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21c0", + "cql": "library MATGlobalCommonFunctions version '4.0.000'\n\n/*For use with program eCQMs during the AU 2019*/\n\nusing QDM version '5.4'\n\nvalueset \"Emergency Department Visit\": 'urn:oid:2.16.840.1.113883.3.117.1.7.1.292' \nvalueset \"Encounter Inpatient\": 'urn:oid:2.16.840.1.113883.3.666.5.307' \nvalueset \"Intensive Care Unit\": 'urn:oid:2.16.840.1.113762.1.4.1110.23' \nvalueset \"Observation Services\": 'urn:oid:2.16.840.1.113762.1.4.1111.143' \nvalueset \"Outpatient Surgery Service\": 'urn:oid:2.16.840.1.113762.1.4.1110.38' \n\nparameter \"Measurement Period\" Interval\n\ncontext Patient\n\ndefine \"Inpatient Encounter\":\n\t[\"Encounter, Performed\": \"Encounter Inpatient\"] EncounterInpatient\n\t\twhere \"LengthInDays\"(EncounterInpatient.relevantPeriod)<= 120\n\t\t\tand EncounterInpatient.relevantPeriod ends during \"Measurement Period\"\n\ndefine \"ED Encounter\":\n\t[\"Encounter, Performed\": \"Emergency Department Visit\"]\n\n/*ToDate takes a given DateTime value and returns a DateTime with the time components \"zeroed\", and the timezone of the input value, for example, given the DateTime @2012-01-01T06:30:00.0Z, this function will return @2012-01-01T00:00:00.0Z.*/\ndefine function \"ToDate\"(Value DateTime ):\n\tDateTime(year from Value, month from Value, day from Value, 0, 0, 0, 0, timezone from Value)\n\n/*CalendarAgeInDaysAt calculates the calendar age (meaning the age without considering time components) in days.*/\ndefine function \"CalendarAgeInDaysAt\"(BirthDateTime DateTime, AsOf DateTime ):\n\tdays between ToDate(BirthDateTime)and ToDate(AsOf)\n\n/*CalendarAgeInDays calculates the calendar age (meaning the age without considering time components) in days as of today*/\ndefine function \"CalendarAgeInDays\"(BirthDateTime DateTime ):\n\tCalendarAgeInDaysAt(BirthDateTime, Today())\n\n/*CalendarAgeInMonthsAt calculates the calendar age (meaning the age without considering time components) in months.*/\ndefine function \"CalendarAgeInMonthsAt\"(BirthDateTime DateTime, AsOf DateTime ):\n\tmonths between ToDate(BirthDateTime)and ToDate(AsOf)\n\n/*CalendarAgeInMonths calculates the calendar age (meaning the age without considering time components) in months as of today.*/\ndefine function \"CalendarAgeInMonths\"(BirthDateTime DateTime ):\n\tCalendarAgeInMonthsAt(BirthDateTime, Today())\n\n/*CalendarAgeInYearsAt calculates the calendar age (meaning the age without considering time components) in years.*/\ndefine function \"CalendarAgeInYearsAt\"(BirthDateTime DateTime, AsOf DateTime ):\n\tyears between ToDate(BirthDateTime)and ToDate(AsOf)\n\n/*CalendarAgeInYears calculates the calendar age (meaning the age without considering time components) in years as of today.*/\ndefine function \"CalendarAgeInYears\"(BirthDateTime DateTime ):\n\tCalendarAgeInYearsAt(BirthDateTime, Today())\n\n/*calculates the difference in calendar days between the start and end of the given interval.*/\ndefine function \"LengthInDays\"(Value Interval ):\n\tdifference in days between start of Value and end of Value\n\n/* returns list of all locations within an encounter, including locations for immediately prior ED visit. */\ndefine function \"HospitalizationLocations\"(Encounter \"Encounter, Performed\" ):\n\tEncounter Visit\n\t\tlet EDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n\t\t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t)\n\t\treturn if EDVisit is null then Visit.facilityLocations \n\t\t\telse flatten { EDVisit.facilityLocations, Visit.facilityLocations }\n\n/*Returns the arrival time in the ED for the encounter. \n*/\ndefine function \"EmergencyDepartmentArrivalTime\"(Encounter \"Encounter, Performed\" ):\n\tstart of First((\"HospitalizationLocations\"(Encounter))HospitalLocation\n\t\t\twhere HospitalLocation.code in \"Emergency Department Visit\"\n\t\t\tsort by start of locationPeriod\n\t).locationPeriod\n\n/*First Inpatient Intensive Care Unit returns the first intensive care unit for\nthe given encounter, without considering any immediately prior emergency\ndepartment visit.*/\ndefine function \"FirstInpatientIntensiveCareUnit\"(Encounter \"Encounter, Performed\" ):\n\tFirst((Encounter.facilityLocations)HospitalLocation\n\t\t\twhere HospitalLocation.code in \"Intensive Care Unit\"\n\t\t\t\tand HospitalLocation.locationPeriod during Encounter.relevantPeriod\n\t\t\tsort by start of locationPeriod\n\t)\n\n/*Returns admission time for an encounter or for immediately prior emergency department visit. */\ndefine function \"HospitalAdmissionTime\"(Encounter \"Encounter, Performed\" ):\n\tstart of \"Hospitalization\"(Encounter)\n\n/*Returns earliest arrival time for an encounter including any prior ED visit. */\ndefine function \"HospitalArrivalTime\"(Encounter \"Encounter, Performed\" ):\n\tstart of First((\"HospitalizationLocations\"(Encounter))HospitalLocation\n\t\t\tsort by start of locationPeriod\n\t).locationPeriod\n\n/*Hospitalization returns the total interval for admission to discharge for the given encounter, or for the admission of any immediately prior emergency department visit to the discharge of the given encounter.*/\ndefine function \"Hospitalization\"(Encounter \"Encounter, Performed\" ):\n\tEncounter Visit\n\t\tlet EDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n\t\t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t)\n\t\treturn Interval[Coalesce(start of EDVisit.relevantPeriod, start of Visit.relevantPeriod), \n\t\tend of Visit.relevantPeriod]\n\n/*Returns the length of stay in days (i.e. the number of days between admission and discharge) for the given encounter, or from the admission of any immediately prior emergency department visit to the discharge of the encounter*/\ndefine function \"HospitalizationLengthofStay\"(Encounter \"Encounter, Performed\" ):\n\tLengthInDays(\"Hospitalization\"(Encounter))\n\n/*Returns the latest departure time for encounter including any prior ED visit. */\ndefine function \"HospitalDepartureTime\"(Encounter \"Encounter, Performed\" ):\n\tend of Last((\"HospitalizationLocations\"(Encounter))HospitalLocation\n\t\t\tsort by start of locationPeriod\n\t).locationPeriod\n\n/*Hospital Discharge Time returns the discharge time for an encounter*/\ndefine function \"HospitalDischargeTime\"(Encounter \"Encounter, Performed\" ):\n\tend of Encounter.relevantPeriod\n\n/*Hospitalization with Observation and Outpatient Surgery Service returns the total interval from the start of any immediately prior emergency department visit, outpatient surgery visit or observation visit to the discharge of the given encounter.*/\ndefine function \"HospitalizationWithObservationAndOutpatientSurgeryService\"(Encounter \"Encounter, Performed\" ):\n\tEncounter Visit\n\t\tlet ObsVisit: Last([\"Encounter, Performed\": \"Observation Services\"] LastObs\n\t\t\t\twhere LastObs.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t),\n\t\tVisitStart: Coalesce(start of ObsVisit.relevantPeriod, start of Visit.relevantPeriod),\n\t\tEDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n\t\t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before VisitStart\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t),\n\t\tVisitStartWithED: Coalesce(start of EDVisit.relevantPeriod, VisitStart),\n\t\tOutpatientSurgeryVisit: Last([\"Encounter, Performed\": \"Outpatient Surgery Service\"] LastSurgeryOP\n\t\t\t\twhere LastSurgeryOP.relevantPeriod ends 1 hour or less on or before VisitStartWithED\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t)\n\t\treturn Interval[Coalesce(start of OutpatientSurgeryVisit.relevantPeriod, VisitStartWithED), \n\t\tend of Visit.relevantPeriod]\n\n/*Hospitalization with Observation returns the total interval from the start of any immediately prior emergency department visit through the observation visit to the discharge of the given encounter*/\ndefine function \"HospitalizationWithObservation\"(Encounter \"Encounter, Performed\" ):\n\tEncounter Visit\n\t\tlet ObsVisit: Last([\"Encounter, Performed\": \"Observation Services\"] LastObs\n\t\t\t\twhere LastObs.relevantPeriod ends 1 hour or less on or before start of Visit.relevantPeriod\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t),\n\t\tVisitStart: Coalesce(start of ObsVisit.relevantPeriod, start of Visit.relevantPeriod),\n\t\tEDVisit: Last([\"Encounter, Performed\": \"Emergency Department Visit\"] LastED\n\t\t\t\twhere LastED.relevantPeriod ends 1 hour or less on or before VisitStart\n\t\t\t\tsort by \n\t\t\t\tend of relevantPeriod\n\t\t)\n\t\treturn Interval[Coalesce(start of EDVisit.relevantPeriod, VisitStart), \n\t\tend of Visit.relevantPeriod]\n\n", + "elm": { + "library": { + "identifier": { + "id": "MATGlobalCommonFunctions", + "version": "4.0.000" + }, + "schemaIdentifier": { + "id": "urn:hl7-org:elm", + "version": "r1" + }, + "usings": { + "def": [ + { + "localIdentifier": "System", + "uri": "urn:hl7-org:elm-types:r1" + }, + { + "localId": "1", + "locator": "5:1-5:23", + "localIdentifier": "QDM", + "uri": "urn:healthit-gov:qdm:v5_4", + "version": "5.4" + } + ] + }, + "parameters": { + "def": [ + { + "localId": "9", + "locator": "13:1-13:49", + "name": "Measurement Period", + "accessLevel": "Public", + "parameterTypeSpecifier": { + "localId": "8", + "locator": "13:32-13:49", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "7", + "locator": "13:41-13:48", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + ] + }, + "valueSets": { + "def": [ + { + "localId": "2", + "locator": "7:1-7:82", + "name": "Emergency Department Visit", + "id": "2.16.840.1.113883.3.117.1.7.1.292", + "accessLevel": "Public" + }, + { + "localId": "3", + "locator": "8:1-8:71", + "name": "Encounter Inpatient", + "id": "2.16.840.1.113883.3.666.5.307", + "accessLevel": "Public" + }, + { + "localId": "4", + "locator": "9:1-9:71", + "name": "Intensive Care Unit", + "id": "2.16.840.1.113762.1.4.1110.23", + "accessLevel": "Public" + }, + { + "localId": "5", + "locator": "10:1-10:73", + "name": "Observation Services", + "id": "2.16.840.1.113762.1.4.1111.143", + "accessLevel": "Public" + }, + { + "localId": "6", + "locator": "11:1-11:78", + "name": "Outpatient Surgery Service", + "id": "2.16.840.1.113762.1.4.1110.38", + "accessLevel": "Public" + } + ] + }, + "statements": { + "def": [ + { + "locator": "15:1-15:15", + "name": "Patient", + "context": "Patient", + "expression": { + "type": "SingletonFrom", + "operand": { + "locator": "15:1-15:15", + "dataType": "{urn:healthit-gov:qdm:v5_4}Patient", + "templateId": "Patient", + "type": "Retrieve" + } + } + }, + { + "localId": "21", + "locator": "54:1-55:59", + "name": "LengthInDays", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "21", + "s": [ + { + "value": [ + "define function ", + "\"LengthInDays\"", + "(", + "Value", + " " + ] + }, + { + "r": "15", + "s": [ + { + "value": [ + "Interval<" + ] + }, + { + "r": "14", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + ">" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "20", + "s": [ + { + "r": "20", + "s": [ + { + "value": [ + "difference in days between " + ] + }, + { + "r": "17", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "16", + "s": [ + { + "value": [ + "Value" + ] + } + ] + } + ] + }, + { + "value": [ + " and " + ] + }, + { + "r": "19", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "18", + "s": [ + { + "value": [ + "Value" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "20", + "locator": "55:2-55:59", + "precision": "Day", + "type": "DifferenceBetween", + "operand": [ + { + "localId": "17", + "locator": "55:29-55:42", + "type": "Start", + "operand": { + "localId": "16", + "locator": "55:38-55:42", + "name": "Value", + "type": "OperandRef" + } + }, + { + "localId": "19", + "locator": "55:48-55:59", + "type": "End", + "operand": { + "localId": "18", + "locator": "55:55-55:59", + "name": "Value", + "type": "OperandRef" + } + } + ] + }, + "operand": [ + { + "name": "Value", + "operandTypeSpecifier": { + "localId": "15", + "locator": "54:38-54:55", + "type": "IntervalTypeSpecifier", + "pointType": { + "localId": "14", + "locator": "54:47-54:54", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + } + ] + }, + { + "localId": "31", + "locator": "17:1-20:73", + "name": "Inpatient Encounter", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "31", + "s": [ + { + "value": [ + "define ", + "\"Inpatient Encounter\"", + ":\n\t" + ] + }, + { + "r": "30", + "s": [ + { + "s": [ + { + "r": "11", + "s": [ + { + "r": "10", + "s": [ + { + "r": "10", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Encounter Inpatient\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "EncounterInpatient" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "29", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "29", + "s": [ + { + "r": "24", + "s": [ + { + "r": "22", + "s": [ + { + "value": [ + "\"LengthInDays\"", + "(" + ] + }, + { + "r": "13", + "s": [ + { + "r": "12", + "s": [ + { + "value": [ + "EncounterInpatient" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "13", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "<=", + " ", + "120" + ] + } + ] + }, + { + "value": [ + "\n\t\t\tand " + ] + }, + { + "r": "28", + "s": [ + { + "r": "26", + "s": [ + { + "r": "25", + "s": [ + { + "value": [ + "EncounterInpatient" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "26", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "ends during", + " " + ] + }, + { + "r": "27", + "s": [ + { + "value": [ + "\"Measurement Period\"" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "30", + "locator": "18:2-20:73", + "type": "Query", + "source": [ + { + "localId": "11", + "locator": "18:2-18:67", + "alias": "EncounterInpatient", + "expression": { + "localId": "10", + "locator": "18:2-18:48", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Encounter Inpatient", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "29", + "locator": "19:3-20:73", + "type": "And", + "operand": [ + { + "localId": "24", + "locator": "19:9-19:63", + "type": "LessOrEqual", + "operand": [ + { + "localId": "22", + "locator": "19:9-19:57", + "name": "LengthInDays", + "type": "FunctionRef", + "operand": [ + { + "localId": "13", + "locator": "19:24-19:56", + "path": "relevantPeriod", + "scope": "EncounterInpatient", + "type": "Property" + } + ] + }, + { + "localId": "23", + "locator": "19:61-19:63", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "120", + "type": "Literal" + } + ] + }, + { + "localId": "28", + "locator": "20:8-20:73", + "type": "In", + "operand": [ + { + "locator": "20:42-20:45", + "type": "End", + "operand": { + "localId": "26", + "locator": "20:8-20:40", + "path": "relevantPeriod", + "scope": "EncounterInpatient", + "type": "Property" + } + }, + { + "localId": "27", + "locator": "20:54-20:73", + "name": "Measurement Period", + "type": "ParameterRef" + } + ] + } + ] + } + } + }, + { + "localId": "33", + "locator": "22:1-23:55", + "name": "ED Encounter", + "context": "Patient", + "accessLevel": "Public", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "33", + "s": [ + { + "value": [ + "define ", + "\"ED Encounter\"", + ":\n\t" + ] + }, + { + "r": "32", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Emergency Department Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "32", + "locator": "23:2-23:55", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Emergency Department Visit", + "type": "ValueSetRef" + } + } + }, + { + "localId": "48", + "locator": "26:1-27:93", + "name": "ToDate", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "48", + "s": [ + { + "value": [ + "define function ", + "\"ToDate\"", + "(", + "Value", + " " + ] + }, + { + "r": "34", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "47", + "s": [ + { + "r": "47", + "s": [ + { + "value": [ + "DateTime", + "(" + ] + }, + { + "r": "36", + "s": [ + { + "value": [ + "year from " + ] + }, + { + "r": "35", + "s": [ + { + "value": [ + "Value" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "38", + "s": [ + { + "value": [ + "month from " + ] + }, + { + "r": "37", + "s": [ + { + "value": [ + "Value" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "40", + "s": [ + { + "value": [ + "day from " + ] + }, + { + "r": "39", + "s": [ + { + "value": [ + "Value" + ] + } + ] + } + ] + }, + { + "value": [ + ", ", + "0", + ", ", + "0", + ", ", + "0", + ", ", + "0", + ", " + ] + }, + { + "r": "46", + "s": [ + { + "value": [ + "timezone from " + ] + }, + { + "r": "45", + "s": [ + { + "value": [ + "Value" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "47", + "locator": "27:2-27:93", + "type": "DateTime", + "year": { + "localId": "36", + "locator": "27:11-27:25", + "precision": "Year", + "type": "DateTimeComponentFrom", + "operand": { + "localId": "35", + "locator": "27:21-27:25", + "name": "Value", + "type": "OperandRef" + } + }, + "month": { + "localId": "38", + "locator": "27:28-27:43", + "precision": "Month", + "type": "DateTimeComponentFrom", + "operand": { + "localId": "37", + "locator": "27:39-27:43", + "name": "Value", + "type": "OperandRef" + } + }, + "day": { + "localId": "40", + "locator": "27:46-27:59", + "precision": "Day", + "type": "DateTimeComponentFrom", + "operand": { + "localId": "39", + "locator": "27:55-27:59", + "name": "Value", + "type": "OperandRef" + } + }, + "hour": { + "localId": "41", + "locator": "27:62", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "type": "Literal" + }, + "minute": { + "localId": "42", + "locator": "27:65", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "type": "Literal" + }, + "second": { + "localId": "43", + "locator": "27:68", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "type": "Literal" + }, + "millisecond": { + "localId": "44", + "locator": "27:71", + "valueType": "{urn:hl7-org:elm-types:r1}Integer", + "value": "0", + "type": "Literal" + }, + "timezoneOffset": { + "localId": "46", + "locator": "27:74-27:92", + "type": "TimezoneFrom", + "operand": { + "localId": "45", + "locator": "27:88-27:92", + "name": "Value", + "type": "OperandRef" + } + } + }, + "operand": [ + { + "name": "Value", + "operandTypeSpecifier": { + "localId": "34", + "locator": "26:32-26:39", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "56", + "locator": "30:1-31:51", + "name": "CalendarAgeInDaysAt", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "56", + "s": [ + { + "value": [ + "define function ", + "\"CalendarAgeInDaysAt\"", + "(", + "BirthDateTime", + " " + ] + }, + { + "r": "49", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + ", ", + "AsOf", + " " + ] + }, + { + "r": "50", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "55", + "s": [ + { + "r": "55", + "s": [ + { + "value": [ + "days between " + ] + }, + { + "r": "52", + "s": [ + { + "value": [ + "ToDate", + "(" + ] + }, + { + "r": "51", + "s": [ + { + "value": [ + "BirthDateTime" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "and " + ] + }, + { + "r": "54", + "s": [ + { + "value": [ + "ToDate", + "(" + ] + }, + { + "r": "53", + "s": [ + { + "value": [ + "AsOf" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "55", + "locator": "31:2-31:51", + "precision": "Day", + "type": "DurationBetween", + "operand": [ + { + "localId": "52", + "locator": "31:15-31:35", + "name": "ToDate", + "type": "FunctionRef", + "operand": [ + { + "localId": "51", + "locator": "31:22-31:34", + "name": "BirthDateTime", + "type": "OperandRef" + } + ] + }, + { + "localId": "54", + "locator": "31:40-31:51", + "name": "ToDate", + "type": "FunctionRef", + "operand": [ + { + "localId": "53", + "locator": "31:47-31:50", + "name": "AsOf", + "type": "OperandRef" + } + ] + } + ] + }, + "operand": [ + { + "name": "BirthDateTime", + "operandTypeSpecifier": { + "localId": "49", + "locator": "30:53-30:60", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + }, + { + "name": "AsOf", + "operandTypeSpecifier": { + "localId": "50", + "locator": "30:68-30:75", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "61", + "locator": "34:1-35:44", + "name": "CalendarAgeInDays", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "61", + "s": [ + { + "value": [ + "define function ", + "\"CalendarAgeInDays\"", + "(", + "BirthDateTime", + " " + ] + }, + { + "r": "57", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "60", + "s": [ + { + "r": "60", + "s": [ + { + "value": [ + "CalendarAgeInDaysAt", + "(" + ] + }, + { + "r": "58", + "s": [ + { + "value": [ + "BirthDateTime" + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "59", + "s": [ + { + "value": [ + "Today", + "()" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "60", + "locator": "35:2-35:44", + "name": "CalendarAgeInDaysAt", + "type": "FunctionRef", + "operand": [ + { + "localId": "58", + "locator": "35:22-35:34", + "name": "BirthDateTime", + "type": "OperandRef" + }, + { + "type": "ToDateTime", + "operand": { + "localId": "59", + "locator": "35:37-35:43", + "type": "Today" + } + } + ] + }, + "operand": [ + { + "name": "BirthDateTime", + "operandTypeSpecifier": { + "localId": "57", + "locator": "34:51-34:58", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "69", + "locator": "38:1-39:53", + "name": "CalendarAgeInMonthsAt", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "69", + "s": [ + { + "value": [ + "define function ", + "\"CalendarAgeInMonthsAt\"", + "(", + "BirthDateTime", + " " + ] + }, + { + "r": "62", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + ", ", + "AsOf", + " " + ] + }, + { + "r": "63", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "68", + "s": [ + { + "r": "68", + "s": [ + { + "value": [ + "months between " + ] + }, + { + "r": "65", + "s": [ + { + "value": [ + "ToDate", + "(" + ] + }, + { + "r": "64", + "s": [ + { + "value": [ + "BirthDateTime" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "and " + ] + }, + { + "r": "67", + "s": [ + { + "value": [ + "ToDate", + "(" + ] + }, + { + "r": "66", + "s": [ + { + "value": [ + "AsOf" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "68", + "locator": "39:2-39:53", + "precision": "Month", + "type": "DurationBetween", + "operand": [ + { + "localId": "65", + "locator": "39:17-39:37", + "name": "ToDate", + "type": "FunctionRef", + "operand": [ + { + "localId": "64", + "locator": "39:24-39:36", + "name": "BirthDateTime", + "type": "OperandRef" + } + ] + }, + { + "localId": "67", + "locator": "39:42-39:53", + "name": "ToDate", + "type": "FunctionRef", + "operand": [ + { + "localId": "66", + "locator": "39:49-39:52", + "name": "AsOf", + "type": "OperandRef" + } + ] + } + ] + }, + "operand": [ + { + "name": "BirthDateTime", + "operandTypeSpecifier": { + "localId": "62", + "locator": "38:55-38:62", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + }, + { + "name": "AsOf", + "operandTypeSpecifier": { + "localId": "63", + "locator": "38:70-38:77", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "74", + "locator": "42:1-43:46", + "name": "CalendarAgeInMonths", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "74", + "s": [ + { + "value": [ + "define function ", + "\"CalendarAgeInMonths\"", + "(", + "BirthDateTime", + " " + ] + }, + { + "r": "70", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "73", + "s": [ + { + "r": "73", + "s": [ + { + "value": [ + "CalendarAgeInMonthsAt", + "(" + ] + }, + { + "r": "71", + "s": [ + { + "value": [ + "BirthDateTime" + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "72", + "s": [ + { + "value": [ + "Today", + "()" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "73", + "locator": "43:2-43:46", + "name": "CalendarAgeInMonthsAt", + "type": "FunctionRef", + "operand": [ + { + "localId": "71", + "locator": "43:24-43:36", + "name": "BirthDateTime", + "type": "OperandRef" + }, + { + "type": "ToDateTime", + "operand": { + "localId": "72", + "locator": "43:39-43:45", + "type": "Today" + } + } + ] + }, + "operand": [ + { + "name": "BirthDateTime", + "operandTypeSpecifier": { + "localId": "70", + "locator": "42:53-42:60", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "82", + "locator": "46:1-47:52", + "name": "CalendarAgeInYearsAt", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "82", + "s": [ + { + "value": [ + "define function ", + "\"CalendarAgeInYearsAt\"", + "(", + "BirthDateTime", + " " + ] + }, + { + "r": "75", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + ", ", + "AsOf", + " " + ] + }, + { + "r": "76", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "81", + "s": [ + { + "r": "81", + "s": [ + { + "value": [ + "years between " + ] + }, + { + "r": "78", + "s": [ + { + "value": [ + "ToDate", + "(" + ] + }, + { + "r": "77", + "s": [ + { + "value": [ + "BirthDateTime" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "and " + ] + }, + { + "r": "80", + "s": [ + { + "value": [ + "ToDate", + "(" + ] + }, + { + "r": "79", + "s": [ + { + "value": [ + "AsOf" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "81", + "locator": "47:2-47:52", + "precision": "Year", + "type": "DurationBetween", + "operand": [ + { + "localId": "78", + "locator": "47:16-47:36", + "name": "ToDate", + "type": "FunctionRef", + "operand": [ + { + "localId": "77", + "locator": "47:23-47:35", + "name": "BirthDateTime", + "type": "OperandRef" + } + ] + }, + { + "localId": "80", + "locator": "47:41-47:52", + "name": "ToDate", + "type": "FunctionRef", + "operand": [ + { + "localId": "79", + "locator": "47:48-47:51", + "name": "AsOf", + "type": "OperandRef" + } + ] + } + ] + }, + "operand": [ + { + "name": "BirthDateTime", + "operandTypeSpecifier": { + "localId": "75", + "locator": "46:54-46:61", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + }, + { + "name": "AsOf", + "operandTypeSpecifier": { + "localId": "76", + "locator": "46:69-46:76", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "87", + "locator": "50:1-51:45", + "name": "CalendarAgeInYears", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "87", + "s": [ + { + "value": [ + "define function ", + "\"CalendarAgeInYears\"", + "(", + "BirthDateTime", + " " + ] + }, + { + "r": "83", + "s": [ + { + "value": [ + "DateTime" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "86", + "s": [ + { + "r": "86", + "s": [ + { + "value": [ + "CalendarAgeInYearsAt", + "(" + ] + }, + { + "r": "84", + "s": [ + { + "value": [ + "BirthDateTime" + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "85", + "s": [ + { + "value": [ + "Today", + "()" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "86", + "locator": "51:2-51:45", + "name": "CalendarAgeInYearsAt", + "type": "FunctionRef", + "operand": [ + { + "localId": "84", + "locator": "51:23-51:35", + "name": "BirthDateTime", + "type": "OperandRef" + }, + { + "type": "ToDateTime", + "operand": { + "localId": "85", + "locator": "51:38-51:44", + "type": "Today" + } + } + ] + }, + "operand": [ + { + "name": "BirthDateTime", + "operandTypeSpecifier": { + "localId": "83", + "locator": "50:52-50:59", + "name": "{urn:hl7-org:elm-types:r1}DateTime", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "123", + "locator": "58:1-66:70", + "name": "HospitalizationLocations", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "123", + "s": [ + { + "value": [ + "define function ", + "\"HospitalizationLocations\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "91", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "122", + "s": [ + { + "r": "122", + "s": [ + { + "s": [ + { + "r": "93", + "s": [ + { + "r": "92", + "s": [ + { + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Visit" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "s": [ + { + "value": [ + "let " + ] + }, + { + "r": "109", + "s": [ + { + "value": [ + "EDVisit", + ": " + ] + }, + { + "r": "108", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "107", + "s": [ + { + "s": [ + { + "r": "95", + "s": [ + { + "r": "94", + "s": [ + { + "r": "94", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Emergency Department Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastED" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "102", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "102", + "s": [ + { + "r": "97", + "s": [ + { + "r": "96", + "s": [ + { + "value": [ + "LastED" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "97", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "102", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "101", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "100", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "99", + "s": [ + { + "r": "98", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "99", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "106", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "105", + "s": [ + { + "r": "104", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "103", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "121", + "s": [ + { + "value": [ + "return " + ] + }, + { + "r": "120", + "s": [ + { + "value": [ + "if " + ] + }, + { + "r": "111", + "s": [ + { + "r": "110", + "s": [ + { + "value": [ + "EDVisit" + ] + } + ] + }, + { + "value": [ + " is null" + ] + } + ] + }, + { + "value": [ + " then " + ] + }, + { + "r": "113", + "s": [ + { + "r": "112", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "113", + "s": [ + { + "value": [ + "facilityLocations" + ] + } + ] + } + ] + }, + { + "value": [ + " \n\t\t\telse " + ] + }, + { + "r": "119", + "s": [ + { + "value": [ + "flatten " + ] + }, + { + "r": "118", + "s": [ + { + "value": [ + "{ " + ] + }, + { + "r": "115", + "s": [ + { + "r": "114", + "s": [ + { + "value": [ + "EDVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "115", + "s": [ + { + "value": [ + "facilityLocations" + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "117", + "s": [ + { + "r": "116", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "117", + "s": [ + { + "value": [ + "facilityLocations" + ] + } + ] + } + ] + }, + { + "value": [ + " }" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "122", + "locator": "59:2-66:70", + "type": "Query", + "source": [ + { + "localId": "93", + "locator": "59:2-59:16", + "alias": "Visit", + "expression": { + "localId": "92", + "locator": "59:2-59:10", + "name": "Encounter", + "type": "OperandRef" + } + } + ], + "let": [ + { + "localId": "109", + "locator": "60:7-64:3", + "identifier": "EDVisit", + "expression": { + "localId": "108", + "locator": "60:16-64:3", + "type": "Last", + "source": { + "localId": "107", + "locator": "60:21-63:25", + "type": "Query", + "source": [ + { + "localId": "95", + "locator": "60:21-60:81", + "alias": "LastED", + "expression": { + "localId": "94", + "locator": "60:21-60:74", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Emergency Department Visit", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "102", + "locator": "61:5-61:94", + "type": "In", + "operand": [ + { + "locator": "61:33-61:36", + "type": "End", + "operand": { + "localId": "97", + "locator": "61:11-61:31", + "path": "relevantPeriod", + "scope": "LastED", + "type": "Property" + } + }, + { + "locator": "61:38-61:51", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "61:66-61:94", + "type": "Subtract", + "operand": [ + { + "localId": "100", + "locator": "61:66-61:94", + "type": "Start", + "operand": { + "localId": "99", + "locator": "61:75-61:94", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + }, + { + "localId": "101", + "locator": "61:38-61:43", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "100", + "locator": "61:66-61:94", + "type": "Start", + "operand": { + "localId": "99", + "locator": "61:75-61:94", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + ] + }, + "sort": { + "localId": "106", + "locator": "62:5-63:25", + "by": [ + { + "localId": "105", + "locator": "63:5-63:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "104", + "locator": "63:5-63:25", + "type": "End", + "operand": { + "localId": "103", + "locator": "63:12-63:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + ], + "relationship": [ + + ], + "return": { + "localId": "121", + "locator": "65:3-66:70", + "expression": { + "localId": "120", + "locator": "65:10-66:70", + "type": "If", + "condition": { + "asType": "{urn:hl7-org:elm-types:r1}Boolean", + "type": "As", + "operand": { + "localId": "111", + "locator": "65:13-65:27", + "type": "IsNull", + "operand": { + "localId": "110", + "locator": "65:13-65:19", + "name": "EDVisit", + "type": "QueryLetRef" + } + } + }, + "then": { + "localId": "113", + "locator": "65:34-65:56", + "path": "facilityLocations", + "scope": "Visit", + "type": "Property" + }, + "else": { + "localId": "119", + "locator": "66:9-66:70", + "type": "Flatten", + "operand": { + "localId": "118", + "locator": "66:17-66:70", + "type": "List", + "element": [ + { + "localId": "115", + "locator": "66:19-66:43", + "path": "facilityLocations", + "type": "Property", + "source": { + "localId": "114", + "locator": "66:19-66:25", + "name": "EDVisit", + "type": "QueryLetRef" + } + }, + { + "localId": "117", + "locator": "66:46-66:68", + "path": "facilityLocations", + "scope": "Visit", + "type": "Property" + } + ] + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "91", + "locator": "58:54-58:75", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "140", + "locator": "70:1-74:17", + "name": "EmergencyDepartmentArrivalTime", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "140", + "s": [ + { + "value": [ + "define function ", + "\"EmergencyDepartmentArrivalTime\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "124", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "139", + "s": [ + { + "r": "139", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "138", + "s": [ + { + "r": "137", + "s": [ + { + "value": [ + "First", + "(" + ] + }, + { + "r": "136", + "s": [ + { + "s": [ + { + "r": "127", + "s": [ + { + "r": "126", + "s": [ + { + "value": [ + "(" + ] + }, + { + "r": "126", + "s": [ + { + "value": [ + "\"HospitalizationLocations\"", + "(" + ] + }, + { + "r": "125", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "HospitalLocation" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "131", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "131", + "s": [ + { + "r": "129", + "s": [ + { + "r": "128", + "s": [ + { + "value": [ + "HospitalLocation" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "129", + "s": [ + { + "value": [ + "code" + ] + } + ] + } + ] + }, + { + "value": [ + " in " + ] + }, + { + "r": "130", + "s": [ + { + "value": [ + "\"Emergency Department Visit\"" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "135", + "s": [ + { + "value": [ + "sort by " + ] + }, + { + "r": "134", + "s": [ + { + "r": "133", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "132", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "138", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "139", + "locator": "71:2-74:17", + "type": "Start", + "operand": { + "localId": "138", + "locator": "71:11-74:17", + "path": "locationPeriod", + "type": "Property", + "source": { + "localId": "137", + "locator": "71:11-74:2", + "type": "First", + "source": { + "localId": "136", + "locator": "71:17-73:34", + "type": "Query", + "source": [ + { + "localId": "127", + "locator": "71:17-71:71", + "alias": "HospitalLocation", + "expression": { + "localId": "126", + "locator": "71:17-71:55", + "name": "HospitalizationLocations", + "type": "FunctionRef", + "operand": [ + { + "localId": "125", + "locator": "71:45-71:53", + "name": "Encounter", + "type": "OperandRef" + } + ] + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "131", + "locator": "72:4-72:62", + "type": "InValueSet", + "code": { + "localId": "129", + "locator": "72:10-72:30", + "path": "code", + "scope": "HospitalLocation", + "type": "Property" + }, + "valueset": { + "localId": "130", + "locator": "72:35-72:62", + "name": "Emergency Department Visit" + } + }, + "sort": { + "localId": "135", + "locator": "73:4-73:34", + "by": [ + { + "localId": "134", + "locator": "73:12-73:34", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "133", + "locator": "73:12-73:34", + "type": "Start", + "operand": { + "localId": "132", + "locator": "73:21-73:34", + "name": "locationPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "124", + "locator": "70:60-70:81", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "161", + "locator": "79:1-84:2", + "name": "FirstInpatientIntensiveCareUnit", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "161", + "s": [ + { + "value": [ + "define function ", + "\"FirstInpatientIntensiveCareUnit\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "141", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "160", + "s": [ + { + "r": "160", + "s": [ + { + "value": [ + "First", + "(" + ] + }, + { + "r": "159", + "s": [ + { + "s": [ + { + "r": "144", + "s": [ + { + "r": "143", + "s": [ + { + "value": [ + "(" + ] + }, + { + "r": "143", + "s": [ + { + "r": "142", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "143", + "s": [ + { + "value": [ + "facilityLocations" + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "HospitalLocation" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "154", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "154", + "s": [ + { + "r": "148", + "s": [ + { + "r": "146", + "s": [ + { + "r": "145", + "s": [ + { + "value": [ + "HospitalLocation" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "146", + "s": [ + { + "value": [ + "code" + ] + } + ] + } + ] + }, + { + "value": [ + " in " + ] + }, + { + "r": "147", + "s": [ + { + "value": [ + "\"Intensive Care Unit\"" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\tand " + ] + }, + { + "r": "153", + "s": [ + { + "r": "150", + "s": [ + { + "r": "149", + "s": [ + { + "value": [ + "HospitalLocation" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "150", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "during", + " " + ] + }, + { + "r": "152", + "s": [ + { + "r": "151", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "152", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "158", + "s": [ + { + "value": [ + "sort by " + ] + }, + { + "r": "157", + "s": [ + { + "r": "156", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "155", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "160", + "locator": "80:2-84:2", + "type": "First", + "source": { + "localId": "159", + "locator": "80:8-83:34", + "type": "Query", + "source": [ + { + "localId": "144", + "locator": "80:8-80:52", + "alias": "HospitalLocation", + "expression": { + "localId": "143", + "locator": "80:8-80:36", + "path": "facilityLocations", + "type": "Property", + "source": { + "localId": "142", + "locator": "80:9-80:17", + "name": "Encounter", + "type": "OperandRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "154", + "locator": "81:4-82:71", + "type": "And", + "operand": [ + { + "localId": "148", + "locator": "81:10-81:55", + "type": "InValueSet", + "code": { + "localId": "146", + "locator": "81:10-81:30", + "path": "code", + "scope": "HospitalLocation", + "type": "Property" + }, + "valueset": { + "localId": "147", + "locator": "81:35-81:55", + "name": "Intensive Care Unit" + } + }, + { + "localId": "153", + "locator": "82:9-82:71", + "type": "IncludedIn", + "operand": [ + { + "localId": "150", + "locator": "82:9-82:39", + "path": "locationPeriod", + "scope": "HospitalLocation", + "type": "Property" + }, + { + "localId": "152", + "locator": "82:48-82:71", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "151", + "locator": "82:48-82:56", + "name": "Encounter", + "type": "OperandRef" + } + } + ] + } + ] + }, + "sort": { + "localId": "158", + "locator": "83:4-83:34", + "by": [ + { + "localId": "157", + "locator": "83:12-83:34", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "156", + "locator": "83:12-83:34", + "type": "Start", + "operand": { + "localId": "155", + "locator": "83:21-83:34", + "name": "locationPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "141", + "locator": "79:61-79:82", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "196", + "locator": "97:1-105:30", + "name": "Hospitalization", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "196", + "s": [ + { + "value": [ + "define function ", + "\"Hospitalization\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "164", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "195", + "s": [ + { + "r": "195", + "s": [ + { + "s": [ + { + "r": "166", + "s": [ + { + "r": "165", + "s": [ + { + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Visit" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "s": [ + { + "value": [ + "let " + ] + }, + { + "r": "182", + "s": [ + { + "value": [ + "EDVisit", + ": " + ] + }, + { + "r": "181", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "180", + "s": [ + { + "s": [ + { + "r": "168", + "s": [ + { + "r": "167", + "s": [ + { + "r": "167", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Emergency Department Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastED" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "175", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "175", + "s": [ + { + "r": "170", + "s": [ + { + "r": "169", + "s": [ + { + "value": [ + "LastED" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "170", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "175", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "174", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "173", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "172", + "s": [ + { + "r": "171", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "172", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "179", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "178", + "s": [ + { + "r": "177", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "176", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "194", + "s": [ + { + "value": [ + "return " + ] + }, + { + "r": "193", + "s": [ + { + "value": [ + "Interval[" + ] + }, + { + "r": "189", + "s": [ + { + "value": [ + "Coalesce", + "(" + ] + }, + { + "r": "185", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "184", + "s": [ + { + "r": "183", + "s": [ + { + "value": [ + "EDVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "184", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "188", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "187", + "s": [ + { + "r": "186", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "187", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ", \n\t\t" + ] + }, + { + "r": "192", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "191", + "s": [ + { + "r": "190", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "191", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "195", + "locator": "98:2-105:30", + "type": "Query", + "source": [ + { + "localId": "166", + "locator": "98:2-98:16", + "alias": "Visit", + "expression": { + "localId": "165", + "locator": "98:2-98:10", + "name": "Encounter", + "type": "OperandRef" + } + } + ], + "let": [ + { + "localId": "182", + "locator": "99:7-103:3", + "identifier": "EDVisit", + "expression": { + "localId": "181", + "locator": "99:16-103:3", + "type": "Last", + "source": { + "localId": "180", + "locator": "99:21-102:25", + "type": "Query", + "source": [ + { + "localId": "168", + "locator": "99:21-99:81", + "alias": "LastED", + "expression": { + "localId": "167", + "locator": "99:21-99:74", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Emergency Department Visit", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "175", + "locator": "100:5-100:94", + "type": "In", + "operand": [ + { + "locator": "100:33-100:36", + "type": "End", + "operand": { + "localId": "170", + "locator": "100:11-100:31", + "path": "relevantPeriod", + "scope": "LastED", + "type": "Property" + } + }, + { + "locator": "100:38-100:51", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "100:66-100:94", + "type": "Subtract", + "operand": [ + { + "localId": "173", + "locator": "100:66-100:94", + "type": "Start", + "operand": { + "localId": "172", + "locator": "100:75-100:94", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + }, + { + "localId": "174", + "locator": "100:38-100:43", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "173", + "locator": "100:66-100:94", + "type": "Start", + "operand": { + "localId": "172", + "locator": "100:75-100:94", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + ] + }, + "sort": { + "localId": "179", + "locator": "101:5-102:25", + "by": [ + { + "localId": "178", + "locator": "102:5-102:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "177", + "locator": "102:5-102:25", + "type": "End", + "operand": { + "localId": "176", + "locator": "102:12-102:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + ], + "relationship": [ + + ], + "return": { + "localId": "194", + "locator": "104:3-105:30", + "expression": { + "localId": "193", + "locator": "104:10-105:30", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "localId": "189", + "locator": "104:19-104:90", + "type": "Coalesce", + "operand": [ + { + "localId": "185", + "locator": "104:28-104:58", + "type": "Start", + "operand": { + "localId": "184", + "locator": "104:37-104:58", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "183", + "locator": "104:37-104:43", + "name": "EDVisit", + "type": "QueryLetRef" + } + } + }, + { + "localId": "188", + "locator": "104:61-104:89", + "type": "Start", + "operand": { + "localId": "187", + "locator": "104:70-104:89", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + ] + }, + "high": { + "localId": "192", + "locator": "105:3-105:29", + "type": "End", + "operand": { + "localId": "191", + "locator": "105:10-105:29", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "164", + "locator": "97:45-97:66", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "199", + "locator": "87:1-88:38", + "name": "HospitalAdmissionTime", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "199", + "s": [ + { + "value": [ + "define function ", + "\"HospitalAdmissionTime\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "162", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "198", + "s": [ + { + "r": "198", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "197", + "s": [ + { + "value": [ + "\"Hospitalization\"", + "(" + ] + }, + { + "r": "163", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "198", + "locator": "88:2-88:38", + "type": "Start", + "operand": { + "localId": "197", + "locator": "88:11-88:38", + "name": "Hospitalization", + "type": "FunctionRef", + "operand": [ + { + "localId": "163", + "locator": "88:29-88:37", + "name": "Encounter", + "type": "OperandRef" + } + ] + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "162", + "locator": "87:51-87:72", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "212", + "locator": "91:1-94:17", + "name": "HospitalArrivalTime", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "212", + "s": [ + { + "value": [ + "define function ", + "\"HospitalArrivalTime\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "200", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "211", + "s": [ + { + "r": "211", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "210", + "s": [ + { + "r": "209", + "s": [ + { + "value": [ + "First", + "(" + ] + }, + { + "r": "208", + "s": [ + { + "s": [ + { + "r": "203", + "s": [ + { + "r": "202", + "s": [ + { + "value": [ + "(" + ] + }, + { + "r": "202", + "s": [ + { + "value": [ + "\"HospitalizationLocations\"", + "(" + ] + }, + { + "r": "201", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "HospitalLocation" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "207", + "s": [ + { + "value": [ + "sort by " + ] + }, + { + "r": "206", + "s": [ + { + "r": "205", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "204", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "210", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "211", + "locator": "92:2-94:17", + "type": "Start", + "operand": { + "localId": "210", + "locator": "92:11-94:17", + "path": "locationPeriod", + "type": "Property", + "source": { + "localId": "209", + "locator": "92:11-94:2", + "type": "First", + "source": { + "localId": "208", + "locator": "92:17-93:34", + "type": "Query", + "source": [ + { + "localId": "203", + "locator": "92:17-92:71", + "alias": "HospitalLocation", + "expression": { + "localId": "202", + "locator": "92:17-92:55", + "name": "HospitalizationLocations", + "type": "FunctionRef", + "operand": [ + { + "localId": "201", + "locator": "92:45-92:53", + "name": "Encounter", + "type": "OperandRef" + } + ] + } + } + ], + "relationship": [ + + ], + "sort": { + "localId": "207", + "locator": "93:4-93:34", + "by": [ + { + "localId": "206", + "locator": "93:12-93:34", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "205", + "locator": "93:12-93:34", + "type": "Start", + "operand": { + "localId": "204", + "locator": "93:21-93:34", + "name": "locationPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "200", + "locator": "91:49-91:70", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "219", + "locator": "108:1-109:43", + "name": "HospitalizationLengthofStay", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "219", + "s": [ + { + "value": [ + "define function ", + "\"HospitalizationLengthofStay\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "215", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "218", + "s": [ + { + "r": "218", + "s": [ + { + "value": [ + "LengthInDays", + "(" + ] + }, + { + "r": "217", + "s": [ + { + "value": [ + "\"Hospitalization\"", + "(" + ] + }, + { + "r": "216", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "218", + "locator": "109:2-109:43", + "name": "LengthInDays", + "type": "FunctionRef", + "operand": [ + { + "localId": "217", + "locator": "109:15-109:42", + "name": "Hospitalization", + "type": "FunctionRef", + "operand": [ + { + "localId": "216", + "locator": "109:33-109:41", + "name": "Encounter", + "type": "OperandRef" + } + ] + } + ] + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "215", + "locator": "108:57-108:78", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "232", + "locator": "112:1-115:17", + "name": "HospitalDepartureTime", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "232", + "s": [ + { + "value": [ + "define function ", + "\"HospitalDepartureTime\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "220", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "231", + "s": [ + { + "r": "231", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "230", + "s": [ + { + "r": "229", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "228", + "s": [ + { + "s": [ + { + "r": "223", + "s": [ + { + "r": "222", + "s": [ + { + "value": [ + "(" + ] + }, + { + "r": "222", + "s": [ + { + "value": [ + "\"HospitalizationLocations\"", + "(" + ] + }, + { + "r": "221", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + "HospitalLocation" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t" + ] + }, + { + "r": "227", + "s": [ + { + "value": [ + "sort by " + ] + }, + { + "r": "226", + "s": [ + { + "r": "225", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "224", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t)" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "230", + "s": [ + { + "value": [ + "locationPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "231", + "locator": "113:2-115:17", + "type": "End", + "operand": { + "localId": "230", + "locator": "113:9-115:17", + "path": "locationPeriod", + "type": "Property", + "source": { + "localId": "229", + "locator": "113:9-115:2", + "type": "Last", + "source": { + "localId": "228", + "locator": "113:14-114:34", + "type": "Query", + "source": [ + { + "localId": "223", + "locator": "113:14-113:68", + "alias": "HospitalLocation", + "expression": { + "localId": "222", + "locator": "113:14-113:52", + "name": "HospitalizationLocations", + "type": "FunctionRef", + "operand": [ + { + "localId": "221", + "locator": "113:42-113:50", + "name": "Encounter", + "type": "OperandRef" + } + ] + } + } + ], + "relationship": [ + + ], + "sort": { + "localId": "227", + "locator": "114:4-114:34", + "by": [ + { + "localId": "226", + "locator": "114:12-114:34", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "225", + "locator": "114:12-114:34", + "type": "Start", + "operand": { + "localId": "224", + "locator": "114:21-114:34", + "name": "locationPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "220", + "locator": "112:51-112:72", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "237", + "locator": "118:1-119:32", + "name": "HospitalDischargeTime", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "237", + "s": [ + { + "value": [ + "define function ", + "\"HospitalDischargeTime\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "233", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "236", + "s": [ + { + "r": "236", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "235", + "s": [ + { + "r": "234", + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "235", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "236", + "locator": "119:2-119:32", + "type": "End", + "operand": { + "localId": "235", + "locator": "119:9-119:32", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "234", + "locator": "119:9-119:17", + "name": "Encounter", + "type": "OperandRef" + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "233", + "locator": "118:51-118:72", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "310", + "locator": "122:1-142:30", + "name": "HospitalizationWithObservationAndOutpatientSurgeryService", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "310", + "s": [ + { + "value": [ + "define function ", + "\"HospitalizationWithObservationAndOutpatientSurgeryService\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "238", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "309", + "s": [ + { + "r": "309", + "s": [ + { + "s": [ + { + "r": "240", + "s": [ + { + "r": "239", + "s": [ + { + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Visit" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "s": [ + { + "value": [ + "let " + ] + }, + { + "r": "256", + "s": [ + { + "value": [ + "ObsVisit", + ": " + ] + }, + { + "r": "255", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "254", + "s": [ + { + "s": [ + { + "r": "242", + "s": [ + { + "r": "241", + "s": [ + { + "r": "241", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Observation Services\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastObs" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "249", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "249", + "s": [ + { + "r": "244", + "s": [ + { + "r": "243", + "s": [ + { + "value": [ + "LastObs" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "244", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "249", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "248", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "247", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "246", + "s": [ + { + "r": "245", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "246", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "253", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "252", + "s": [ + { + "r": "251", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "250", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + }, + { + "value": [ + ",\n\t\t" + ] + }, + { + "r": "264", + "s": [ + { + "value": [ + "VisitStart", + ": " + ] + }, + { + "r": "263", + "s": [ + { + "value": [ + "Coalesce", + "(" + ] + }, + { + "r": "259", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "258", + "s": [ + { + "r": "257", + "s": [ + { + "value": [ + "ObsVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "258", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "262", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "261", + "s": [ + { + "r": "260", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "261", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + ",\n\t\t" + ] + }, + { + "r": "278", + "s": [ + { + "value": [ + "EDVisit", + ": " + ] + }, + { + "r": "277", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "276", + "s": [ + { + "s": [ + { + "r": "266", + "s": [ + { + "r": "265", + "s": [ + { + "r": "265", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Emergency Department Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastED" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "271", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "271", + "s": [ + { + "r": "268", + "s": [ + { + "r": "267", + "s": [ + { + "value": [ + "LastED" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "268", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "271", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "270", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "269", + "s": [ + { + "value": [ + "VisitStart" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "275", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "274", + "s": [ + { + "r": "273", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "272", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + }, + { + "value": [ + ",\n\t\t" + ] + }, + { + "r": "284", + "s": [ + { + "value": [ + "VisitStartWithED", + ": " + ] + }, + { + "r": "283", + "s": [ + { + "value": [ + "Coalesce", + "(" + ] + }, + { + "r": "281", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "280", + "s": [ + { + "r": "279", + "s": [ + { + "value": [ + "EDVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "280", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "282", + "s": [ + { + "value": [ + "VisitStart" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + ",\n\t\t" + ] + }, + { + "r": "298", + "s": [ + { + "value": [ + "OutpatientSurgeryVisit", + ": " + ] + }, + { + "r": "297", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "296", + "s": [ + { + "s": [ + { + "r": "286", + "s": [ + { + "r": "285", + "s": [ + { + "r": "285", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Outpatient Surgery Service\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastSurgeryOP" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "291", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "291", + "s": [ + { + "r": "288", + "s": [ + { + "r": "287", + "s": [ + { + "value": [ + "LastSurgeryOP" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "288", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "291", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "290", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "289", + "s": [ + { + "value": [ + "VisitStartWithED" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "295", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "294", + "s": [ + { + "r": "293", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "292", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "308", + "s": [ + { + "value": [ + "return " + ] + }, + { + "r": "307", + "s": [ + { + "value": [ + "Interval[" + ] + }, + { + "r": "303", + "s": [ + { + "value": [ + "Coalesce", + "(" + ] + }, + { + "r": "301", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "300", + "s": [ + { + "r": "299", + "s": [ + { + "value": [ + "OutpatientSurgeryVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "300", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "302", + "s": [ + { + "value": [ + "VisitStartWithED" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ", \n\t\t" + ] + }, + { + "r": "306", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "305", + "s": [ + { + "r": "304", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "305", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "309", + "locator": "123:2-142:30", + "type": "Query", + "source": [ + { + "localId": "240", + "locator": "123:2-123:16", + "alias": "Visit", + "expression": { + "localId": "239", + "locator": "123:2-123:10", + "name": "Encounter", + "type": "OperandRef" + } + } + ], + "let": [ + { + "localId": "256", + "locator": "124:7-128:3", + "identifier": "ObsVisit", + "expression": { + "localId": "255", + "locator": "124:17-128:3", + "type": "Last", + "source": { + "localId": "254", + "locator": "124:22-127:25", + "type": "Query", + "source": [ + { + "localId": "242", + "locator": "124:22-124:77", + "alias": "LastObs", + "expression": { + "localId": "241", + "locator": "124:22-124:69", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Observation Services", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "249", + "locator": "125:5-125:95", + "type": "In", + "operand": [ + { + "locator": "125:34-125:37", + "type": "End", + "operand": { + "localId": "244", + "locator": "125:11-125:32", + "path": "relevantPeriod", + "scope": "LastObs", + "type": "Property" + } + }, + { + "locator": "125:39-125:52", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "125:67-125:95", + "type": "Subtract", + "operand": [ + { + "localId": "247", + "locator": "125:67-125:95", + "type": "Start", + "operand": { + "localId": "246", + "locator": "125:76-125:95", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + }, + { + "localId": "248", + "locator": "125:39-125:44", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "247", + "locator": "125:67-125:95", + "type": "Start", + "operand": { + "localId": "246", + "locator": "125:76-125:95", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + ] + }, + "sort": { + "localId": "253", + "locator": "126:5-127:25", + "by": [ + { + "localId": "252", + "locator": "127:5-127:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "251", + "locator": "127:5-127:25", + "type": "End", + "operand": { + "localId": "250", + "locator": "127:12-127:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + }, + { + "localId": "264", + "locator": "129:3-129:87", + "identifier": "VisitStart", + "expression": { + "localId": "263", + "locator": "129:15-129:87", + "type": "Coalesce", + "operand": [ + { + "localId": "259", + "locator": "129:24-129:55", + "type": "Start", + "operand": { + "localId": "258", + "locator": "129:33-129:55", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "257", + "locator": "129:33-129:40", + "name": "ObsVisit", + "type": "QueryLetRef" + } + } + }, + { + "localId": "262", + "locator": "129:58-129:86", + "type": "Start", + "operand": { + "localId": "261", + "locator": "129:67-129:86", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + ] + } + }, + { + "localId": "278", + "locator": "130:3-134:3", + "identifier": "EDVisit", + "expression": { + "localId": "277", + "locator": "130:12-134:3", + "type": "Last", + "source": { + "localId": "276", + "locator": "130:17-133:25", + "type": "Query", + "source": [ + { + "localId": "266", + "locator": "130:17-130:77", + "alias": "LastED", + "expression": { + "localId": "265", + "locator": "130:17-130:70", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Emergency Department Visit", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "271", + "locator": "131:5-131:75", + "type": "In", + "operand": [ + { + "locator": "131:33-131:36", + "type": "End", + "operand": { + "localId": "268", + "locator": "131:11-131:31", + "path": "relevantPeriod", + "scope": "LastED", + "type": "Property" + } + }, + { + "locator": "131:38-131:51", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "131:66-131:75", + "type": "Subtract", + "operand": [ + { + "localId": "269", + "locator": "131:66-131:75", + "name": "VisitStart", + "type": "QueryLetRef" + }, + { + "localId": "270", + "locator": "131:38-131:43", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "269", + "locator": "131:66-131:75", + "name": "VisitStart", + "type": "QueryLetRef" + } + } + ] + }, + "sort": { + "localId": "275", + "locator": "132:5-133:25", + "by": [ + { + "localId": "274", + "locator": "133:5-133:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "273", + "locator": "133:5-133:25", + "type": "End", + "operand": { + "localId": "272", + "locator": "133:12-133:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + }, + { + "localId": "284", + "locator": "135:3-135:73", + "identifier": "VisitStartWithED", + "expression": { + "localId": "283", + "locator": "135:21-135:73", + "type": "Coalesce", + "operand": [ + { + "localId": "281", + "locator": "135:30-135:60", + "type": "Start", + "operand": { + "localId": "280", + "locator": "135:39-135:60", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "279", + "locator": "135:39-135:45", + "name": "EDVisit", + "type": "QueryLetRef" + } + } + }, + { + "localId": "282", + "locator": "135:63-135:72", + "name": "VisitStart", + "type": "QueryLetRef" + } + ] + } + }, + { + "localId": "298", + "locator": "136:3-140:3", + "identifier": "OutpatientSurgeryVisit", + "expression": { + "localId": "297", + "locator": "136:27-140:3", + "type": "Last", + "source": { + "localId": "296", + "locator": "136:32-139:25", + "type": "Query", + "source": [ + { + "localId": "286", + "locator": "136:32-136:99", + "alias": "LastSurgeryOP", + "expression": { + "localId": "285", + "locator": "136:32-136:85", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Outpatient Surgery Service", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "291", + "locator": "137:5-137:88", + "type": "In", + "operand": [ + { + "locator": "137:40-137:43", + "type": "End", + "operand": { + "localId": "288", + "locator": "137:11-137:38", + "path": "relevantPeriod", + "scope": "LastSurgeryOP", + "type": "Property" + } + }, + { + "locator": "137:45-137:58", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "137:73-137:88", + "type": "Subtract", + "operand": [ + { + "localId": "289", + "locator": "137:73-137:88", + "name": "VisitStartWithED", + "type": "QueryLetRef" + }, + { + "localId": "290", + "locator": "137:45-137:50", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "289", + "locator": "137:73-137:88", + "name": "VisitStartWithED", + "type": "QueryLetRef" + } + } + ] + }, + "sort": { + "localId": "295", + "locator": "138:5-139:25", + "by": [ + { + "localId": "294", + "locator": "139:5-139:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "293", + "locator": "139:5-139:25", + "type": "End", + "operand": { + "localId": "292", + "locator": "139:12-139:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + ], + "relationship": [ + + ], + "return": { + "localId": "308", + "locator": "141:3-142:30", + "expression": { + "localId": "307", + "locator": "141:10-142:30", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "localId": "303", + "locator": "141:19-141:92", + "type": "Coalesce", + "operand": [ + { + "localId": "301", + "locator": "141:28-141:73", + "type": "Start", + "operand": { + "localId": "300", + "locator": "141:37-141:73", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "299", + "locator": "141:37-141:58", + "name": "OutpatientSurgeryVisit", + "type": "QueryLetRef" + } + } + }, + { + "localId": "302", + "locator": "141:76-141:91", + "name": "VisitStartWithED", + "type": "QueryLetRef" + } + ] + }, + "high": { + "localId": "306", + "locator": "142:3-142:29", + "type": "End", + "operand": { + "localId": "305", + "locator": "142:10-142:29", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "238", + "locator": "122:87-122:108", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + }, + { + "localId": "363", + "locator": "145:1-159:30", + "name": "HospitalizationWithObservation", + "context": "Patient", + "accessLevel": "Public", + "type": "FunctionDef", + "annotation": [ + { + "type": "Annotation", + "s": { + "r": "363", + "s": [ + { + "value": [ + "define function ", + "\"HospitalizationWithObservation\"", + "(", + "Encounter", + " " + ] + }, + { + "r": "311", + "s": [ + { + "value": [ + "\"Encounter, Performed\"" + ] + } + ] + }, + { + "value": [ + " ):\n\t" + ] + }, + { + "r": "362", + "s": [ + { + "r": "362", + "s": [ + { + "s": [ + { + "r": "313", + "s": [ + { + "r": "312", + "s": [ + { + "s": [ + { + "value": [ + "Encounter" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "Visit" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "s": [ + { + "value": [ + "let " + ] + }, + { + "r": "329", + "s": [ + { + "value": [ + "ObsVisit", + ": " + ] + }, + { + "r": "328", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "327", + "s": [ + { + "s": [ + { + "r": "315", + "s": [ + { + "r": "314", + "s": [ + { + "r": "314", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Observation Services\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastObs" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "322", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "322", + "s": [ + { + "r": "317", + "s": [ + { + "r": "316", + "s": [ + { + "value": [ + "LastObs" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "317", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "322", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "321", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "320", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "319", + "s": [ + { + "r": "318", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "319", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "326", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "325", + "s": [ + { + "r": "324", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "323", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + }, + { + "value": [ + ",\n\t\t" + ] + }, + { + "r": "337", + "s": [ + { + "value": [ + "VisitStart", + ": " + ] + }, + { + "r": "336", + "s": [ + { + "value": [ + "Coalesce", + "(" + ] + }, + { + "r": "332", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "331", + "s": [ + { + "r": "330", + "s": [ + { + "value": [ + "ObsVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "331", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "335", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "334", + "s": [ + { + "r": "333", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "334", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + } + ] + }, + { + "value": [ + ",\n\t\t" + ] + }, + { + "r": "351", + "s": [ + { + "value": [ + "EDVisit", + ": " + ] + }, + { + "r": "350", + "s": [ + { + "value": [ + "Last", + "(" + ] + }, + { + "r": "349", + "s": [ + { + "s": [ + { + "r": "339", + "s": [ + { + "r": "338", + "s": [ + { + "r": "338", + "s": [ + { + "value": [ + "[", + "\"Encounter, Performed\"", + ": " + ] + }, + { + "s": [ + { + "value": [ + "\"Emergency Department Visit\"" + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + }, + { + "value": [ + " ", + "LastED" + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "344", + "s": [ + { + "value": [ + "where " + ] + }, + { + "r": "344", + "s": [ + { + "r": "341", + "s": [ + { + "r": "340", + "s": [ + { + "value": [ + "LastED" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "341", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "344", + "s": [ + { + "value": [ + "ends " + ] + }, + { + "r": "343", + "s": [ + { + "value": [ + "1 ", + "hour" + ] + } + ] + }, + { + "value": [ + " or less on or before" + ] + } + ] + }, + { + "value": [ + " " + ] + }, + { + "r": "342", + "s": [ + { + "value": [ + "VisitStart" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t\t\t" + ] + }, + { + "r": "348", + "s": [ + { + "value": [ + "sort by \n\t\t\t\t" + ] + }, + { + "r": "347", + "s": [ + { + "r": "346", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "345", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t)" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "\n\t\t" + ] + }, + { + "r": "361", + "s": [ + { + "value": [ + "return " + ] + }, + { + "r": "360", + "s": [ + { + "value": [ + "Interval[" + ] + }, + { + "r": "356", + "s": [ + { + "value": [ + "Coalesce", + "(" + ] + }, + { + "r": "354", + "s": [ + { + "value": [ + "start of " + ] + }, + { + "r": "353", + "s": [ + { + "r": "352", + "s": [ + { + "value": [ + "EDVisit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "353", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + ", " + ] + }, + { + "r": "355", + "s": [ + { + "value": [ + "VisitStart" + ] + } + ] + }, + { + "value": [ + ")" + ] + } + ] + }, + { + "value": [ + ", \n\t\t" + ] + }, + { + "r": "359", + "s": [ + { + "value": [ + "end of " + ] + }, + { + "r": "358", + "s": [ + { + "r": "357", + "s": [ + { + "value": [ + "Visit" + ] + } + ] + }, + { + "value": [ + "." + ] + }, + { + "r": "358", + "s": [ + { + "value": [ + "relevantPeriod" + ] + } + ] + } + ] + } + ] + }, + { + "value": [ + "]" + ] + } + ] + } + ] + } + ] + } + ] + } + ] + } + } + ], + "expression": { + "localId": "362", + "locator": "146:2-159:30", + "type": "Query", + "source": [ + { + "localId": "313", + "locator": "146:2-146:16", + "alias": "Visit", + "expression": { + "localId": "312", + "locator": "146:2-146:10", + "name": "Encounter", + "type": "OperandRef" + } + } + ], + "let": [ + { + "localId": "329", + "locator": "147:7-151:3", + "identifier": "ObsVisit", + "expression": { + "localId": "328", + "locator": "147:17-151:3", + "type": "Last", + "source": { + "localId": "327", + "locator": "147:22-150:25", + "type": "Query", + "source": [ + { + "localId": "315", + "locator": "147:22-147:77", + "alias": "LastObs", + "expression": { + "localId": "314", + "locator": "147:22-147:69", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Observation Services", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "322", + "locator": "148:5-148:95", + "type": "In", + "operand": [ + { + "locator": "148:34-148:37", + "type": "End", + "operand": { + "localId": "317", + "locator": "148:11-148:32", + "path": "relevantPeriod", + "scope": "LastObs", + "type": "Property" + } + }, + { + "locator": "148:39-148:52", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "148:67-148:95", + "type": "Subtract", + "operand": [ + { + "localId": "320", + "locator": "148:67-148:95", + "type": "Start", + "operand": { + "localId": "319", + "locator": "148:76-148:95", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + }, + { + "localId": "321", + "locator": "148:39-148:44", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "320", + "locator": "148:67-148:95", + "type": "Start", + "operand": { + "localId": "319", + "locator": "148:76-148:95", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + ] + }, + "sort": { + "localId": "326", + "locator": "149:5-150:25", + "by": [ + { + "localId": "325", + "locator": "150:5-150:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "324", + "locator": "150:5-150:25", + "type": "End", + "operand": { + "localId": "323", + "locator": "150:12-150:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + }, + { + "localId": "337", + "locator": "152:3-152:87", + "identifier": "VisitStart", + "expression": { + "localId": "336", + "locator": "152:15-152:87", + "type": "Coalesce", + "operand": [ + { + "localId": "332", + "locator": "152:24-152:55", + "type": "Start", + "operand": { + "localId": "331", + "locator": "152:33-152:55", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "330", + "locator": "152:33-152:40", + "name": "ObsVisit", + "type": "QueryLetRef" + } + } + }, + { + "localId": "335", + "locator": "152:58-152:86", + "type": "Start", + "operand": { + "localId": "334", + "locator": "152:67-152:86", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + ] + } + }, + { + "localId": "351", + "locator": "153:3-157:3", + "identifier": "EDVisit", + "expression": { + "localId": "350", + "locator": "153:12-157:3", + "type": "Last", + "source": { + "localId": "349", + "locator": "153:17-156:25", + "type": "Query", + "source": [ + { + "localId": "339", + "locator": "153:17-153:77", + "alias": "LastED", + "expression": { + "localId": "338", + "locator": "153:17-153:70", + "dataType": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "templateId": "PositiveEncounterPerformed", + "codeProperty": "code", + "type": "Retrieve", + "codes": { + "name": "Emergency Department Visit", + "type": "ValueSetRef" + } + } + } + ], + "relationship": [ + + ], + "where": { + "localId": "344", + "locator": "154:5-154:75", + "type": "In", + "operand": [ + { + "locator": "154:33-154:36", + "type": "End", + "operand": { + "localId": "341", + "locator": "154:11-154:31", + "path": "relevantPeriod", + "scope": "LastED", + "type": "Property" + } + }, + { + "locator": "154:38-154:51", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "locator": "154:66-154:75", + "type": "Subtract", + "operand": [ + { + "localId": "342", + "locator": "154:66-154:75", + "name": "VisitStart", + "type": "QueryLetRef" + }, + { + "localId": "343", + "locator": "154:38-154:43", + "value": 1, + "unit": "hour", + "type": "Quantity" + } + ] + }, + "high": { + "localId": "342", + "locator": "154:66-154:75", + "name": "VisitStart", + "type": "QueryLetRef" + } + } + ] + }, + "sort": { + "localId": "348", + "locator": "155:5-156:25", + "by": [ + { + "localId": "347", + "locator": "156:5-156:25", + "direction": "asc", + "type": "ByExpression", + "expression": { + "localId": "346", + "locator": "156:5-156:25", + "type": "End", + "operand": { + "localId": "345", + "locator": "156:12-156:25", + "name": "relevantPeriod", + "type": "IdentifierRef" + } + } + } + ] + } + } + } + } + ], + "relationship": [ + + ], + "return": { + "localId": "361", + "locator": "158:3-159:30", + "expression": { + "localId": "360", + "locator": "158:10-159:30", + "lowClosed": true, + "highClosed": true, + "type": "Interval", + "low": { + "localId": "356", + "locator": "158:19-158:71", + "type": "Coalesce", + "operand": [ + { + "localId": "354", + "locator": "158:28-158:58", + "type": "Start", + "operand": { + "localId": "353", + "locator": "158:37-158:58", + "path": "relevantPeriod", + "type": "Property", + "source": { + "localId": "352", + "locator": "158:37-158:43", + "name": "EDVisit", + "type": "QueryLetRef" + } + } + }, + { + "localId": "355", + "locator": "158:61-158:70", + "name": "VisitStart", + "type": "QueryLetRef" + } + ] + }, + "high": { + "localId": "359", + "locator": "159:3-159:29", + "type": "End", + "operand": { + "localId": "358", + "locator": "159:10-159:29", + "path": "relevantPeriod", + "scope": "Visit", + "type": "Property" + } + } + } + } + }, + "operand": [ + { + "name": "Encounter", + "operandTypeSpecifier": { + "localId": "311", + "locator": "145:60-145:81", + "name": "{urn:healthit-gov:qdm:v5_4}PositiveEncounterPerformed", + "type": "NamedTypeSpecifier" + } + } + ] + } + ] + } + } + }, + "elm_annotations": { + "statements": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"LengthInDays\"(Value " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval<" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "14" + }, + { + "children": [ + { + "text": ">" + } + ] + } + ], + "ref_id": "15" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "difference in days between " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Value" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "16" + } + ], + "node_type": "Start", + "ref_id": "17" + }, + { + "children": [ + { + "text": " and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Value" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "18" + } + ], + "node_type": "End", + "ref_id": "19" + } + ], + "node_type": "DifferenceBetween", + "ref_id": "20" + } + ], + "node_type": "DifferenceBetween", + "ref_id": "20" + } + ], + "ref_id": "21" + } + ], + "define_name": "LengthInDays" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"Inpatient Encounter\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter Inpatient\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "10" + } + ], + "node_type": "Retrieve", + "ref_id": "10" + }, + { + "children": [ + { + "text": " EncounterInpatient" + } + ] + } + ], + "ref_id": "11" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "\"LengthInDays\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EncounterInpatient" + } + ] + } + ], + "ref_id": "12" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "13" + } + ], + "node_type": "Property", + "ref_id": "13" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "22" + }, + { + "children": [ + { + "text": "<= 120" + } + ] + } + ], + "node_type": "LessOrEqual", + "ref_id": "24" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EncounterInpatient" + } + ] + } + ], + "ref_id": "25" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "26" + } + ], + "node_type": "Property", + "ref_id": "26" + }, + { + "children": [ + { + "text": " ends during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Measurement Period\"" + } + ] + } + ], + "node_type": "ParameterRef", + "ref_id": "27" + } + ], + "node_type": "In", + "ref_id": "28" + } + ], + "ref_id": "29" + } + ], + "ref_id": "29" + } + ], + "node_type": "Query", + "ref_id": "30" + } + ], + "ref_id": "31" + } + ], + "define_name": "Inpatient Encounter" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define \"ED Encounter\":\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Emergency Department Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "32" + } + ], + "ref_id": "33" + } + ], + "define_name": "ED Encounter" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"ToDate\"(Value " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "34" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "DateTime(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "year from " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Value" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "35" + } + ], + "ref_id": "36" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "month from " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Value" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "37" + } + ], + "ref_id": "38" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "day from " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Value" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "39" + } + ], + "ref_id": "40" + }, + { + "children": [ + { + "text": ", 0, 0, 0, 0, " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "timezone from " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Value" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "45" + } + ], + "ref_id": "46" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "DateTime", + "ref_id": "47" + } + ], + "node_type": "DateTime", + "ref_id": "47" + } + ], + "ref_id": "48" + } + ], + "define_name": "ToDate" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CalendarAgeInDaysAt\"(BirthDateTime " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "49" + }, + { + "children": [ + { + "text": ", AsOf " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "50" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "days between " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ToDate(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "BirthDateTime" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "51" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "52" + }, + { + "children": [ + { + "text": "and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ToDate(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "AsOf" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "53" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "54" + } + ], + "node_type": "DurationBetween", + "ref_id": "55" + } + ], + "node_type": "DurationBetween", + "ref_id": "55" + } + ], + "ref_id": "56" + } + ], + "define_name": "CalendarAgeInDaysAt" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CalendarAgeInDays\"(BirthDateTime " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "57" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "CalendarAgeInDaysAt(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "BirthDateTime" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "58" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Today()" + } + ] + } + ], + "node_type": "Today", + "ref_id": "59" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "60" + } + ], + "node_type": "FunctionRef", + "ref_id": "60" + } + ], + "ref_id": "61" + } + ], + "define_name": "CalendarAgeInDays" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CalendarAgeInMonthsAt\"(BirthDateTime " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "62" + }, + { + "children": [ + { + "text": ", AsOf " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "63" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "months between " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ToDate(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "BirthDateTime" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "64" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "65" + }, + { + "children": [ + { + "text": "and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ToDate(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "AsOf" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "66" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "67" + } + ], + "node_type": "DurationBetween", + "ref_id": "68" + } + ], + "node_type": "DurationBetween", + "ref_id": "68" + } + ], + "ref_id": "69" + } + ], + "define_name": "CalendarAgeInMonthsAt" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CalendarAgeInMonths\"(BirthDateTime " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "70" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "CalendarAgeInMonthsAt(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "BirthDateTime" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "71" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Today()" + } + ] + } + ], + "node_type": "Today", + "ref_id": "72" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "73" + } + ], + "node_type": "FunctionRef", + "ref_id": "73" + } + ], + "ref_id": "74" + } + ], + "define_name": "CalendarAgeInMonths" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CalendarAgeInYearsAt\"(BirthDateTime " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "75" + }, + { + "children": [ + { + "text": ", AsOf " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "76" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "years between " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ToDate(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "BirthDateTime" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "77" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "78" + }, + { + "children": [ + { + "text": "and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ToDate(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "AsOf" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "79" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "80" + } + ], + "node_type": "DurationBetween", + "ref_id": "81" + } + ], + "node_type": "DurationBetween", + "ref_id": "81" + } + ], + "ref_id": "82" + } + ], + "define_name": "CalendarAgeInYearsAt" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"CalendarAgeInYears\"(BirthDateTime " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "DateTime" + } + ] + } + ], + "ref_id": "83" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "CalendarAgeInYearsAt(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "BirthDateTime" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "84" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Today()" + } + ] + } + ], + "node_type": "Today", + "ref_id": "85" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "86" + } + ], + "node_type": "FunctionRef", + "ref_id": "86" + } + ], + "ref_id": "87" + } + ], + "define_name": "CalendarAgeInYears" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalizationLocations\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "91" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "92" + }, + { + "children": [ + { + "text": " Visit" + } + ] + } + ], + "ref_id": "93" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "let " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "EDVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Emergency Department Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "94" + } + ], + "node_type": "Retrieve", + "ref_id": "94" + }, + { + "children": [ + { + "text": " LastED" + } + ] + } + ], + "ref_id": "95" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastED" + } + ] + } + ], + "ref_id": "96" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "97" + } + ], + "node_type": "Property", + "ref_id": "97" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "101" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "102" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "98" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "99" + } + ], + "node_type": "Property", + "ref_id": "99" + } + ], + "node_type": "Start", + "ref_id": "100" + } + ], + "ref_id": "102" + } + ], + "ref_id": "102" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "103" + } + ], + "node_type": "End", + "ref_id": "104" + } + ], + "ref_id": "105" + } + ], + "ref_id": "106" + } + ], + "ref_id": "107" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "108" + } + ], + "ref_id": "109" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "return " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "if " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EDVisit" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "110" + }, + { + "children": [ + { + "text": " is null" + } + ] + } + ], + "node_type": "IsNull", + "ref_id": "111" + }, + { + "children": [ + { + "text": " then " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "112" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "facilityLocations" + } + ] + } + ], + "ref_id": "113" + } + ], + "ref_id": "113" + }, + { + "children": [ + { + "text": " \n else " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "flatten " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "{ " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EDVisit" + } + ] + } + ], + "ref_id": "114" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "facilityLocations" + } + ] + } + ], + "ref_id": "115" + } + ], + "ref_id": "115" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "116" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "facilityLocations" + } + ] + } + ], + "ref_id": "117" + } + ], + "ref_id": "117" + }, + { + "children": [ + { + "text": " }" + } + ] + } + ], + "node_type": "List", + "ref_id": "118" + } + ], + "ref_id": "119" + } + ], + "node_type": "If", + "ref_id": "120" + } + ], + "ref_id": "121" + } + ], + "node_type": "Query", + "ref_id": "122" + } + ], + "node_type": "Query", + "ref_id": "122" + } + ], + "ref_id": "123" + } + ], + "define_name": "HospitalizationLocations" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"EmergencyDepartmentArrivalTime\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "124" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "First(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"HospitalizationLocations\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "125" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "126" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "126" + }, + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "127" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "128" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "code" + } + ] + } + ], + "ref_id": "129" + } + ], + "ref_id": "129" + }, + { + "children": [ + { + "text": " in " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Emergency Department Visit\"" + } + ] + } + ], + "ref_id": "130" + } + ], + "ref_id": "131" + } + ], + "ref_id": "131" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "132" + } + ], + "node_type": "Start", + "ref_id": "133" + } + ], + "ref_id": "134" + } + ], + "ref_id": "135" + } + ], + "ref_id": "136" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "ref_id": "137" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "138" + } + ], + "node_type": "Property", + "ref_id": "138" + } + ], + "node_type": "Start", + "ref_id": "139" + } + ], + "node_type": "Start", + "ref_id": "139" + } + ], + "ref_id": "140" + } + ], + "define_name": "EmergencyDepartmentArrivalTime" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"FirstInpatientIntensiveCareUnit\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "141" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "First(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "ref_id": "142" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "facilityLocations" + } + ] + } + ], + "node_type": "Property", + "ref_id": "143" + } + ], + "node_type": "Property", + "ref_id": "143" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Property", + "ref_id": "143" + }, + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "144" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "145" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "code" + } + ] + } + ], + "ref_id": "146" + } + ], + "ref_id": "146" + }, + { + "children": [ + { + "text": " in " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Intensive Care Unit\"" + } + ] + } + ], + "ref_id": "147" + } + ], + "node_type": "InValueSet", + "ref_id": "148" + }, + { + "children": [ + { + "text": "\n and " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "149" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "150" + } + ], + "node_type": "Property", + "ref_id": "150" + }, + { + "children": [ + { + "text": " during " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "ref_id": "151" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "152" + } + ], + "node_type": "Property", + "ref_id": "152" + } + ], + "node_type": "IncludedIn", + "ref_id": "153" + } + ], + "ref_id": "154" + } + ], + "ref_id": "154" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "155" + } + ], + "node_type": "Start", + "ref_id": "156" + } + ], + "ref_id": "157" + } + ], + "ref_id": "158" + } + ], + "ref_id": "159" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "First", + "ref_id": "160" + } + ], + "node_type": "First", + "ref_id": "160" + } + ], + "ref_id": "161" + } + ], + "define_name": "FirstInpatientIntensiveCareUnit" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"Hospitalization\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "164" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "165" + }, + { + "children": [ + { + "text": " Visit" + } + ] + } + ], + "ref_id": "166" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "let " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "EDVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Emergency Department Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "167" + } + ], + "node_type": "Retrieve", + "ref_id": "167" + }, + { + "children": [ + { + "text": " LastED" + } + ] + } + ], + "ref_id": "168" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastED" + } + ] + } + ], + "ref_id": "169" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "170" + } + ], + "node_type": "Property", + "ref_id": "170" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "174" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "175" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "171" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "172" + } + ], + "node_type": "Property", + "ref_id": "172" + } + ], + "node_type": "Start", + "ref_id": "173" + } + ], + "ref_id": "175" + } + ], + "ref_id": "175" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "176" + } + ], + "node_type": "End", + "ref_id": "177" + } + ], + "ref_id": "178" + } + ], + "ref_id": "179" + } + ], + "ref_id": "180" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "181" + } + ], + "ref_id": "182" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "return " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval[" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Coalesce(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EDVisit" + } + ] + } + ], + "ref_id": "183" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "184" + } + ], + "node_type": "Property", + "ref_id": "184" + } + ], + "node_type": "Start", + "ref_id": "185" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "186" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "187" + } + ], + "node_type": "Property", + "ref_id": "187" + } + ], + "node_type": "Start", + "ref_id": "188" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "ref_id": "189" + }, + { + "children": [ + { + "text": ", \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "190" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "191" + } + ], + "node_type": "Property", + "ref_id": "191" + } + ], + "ref_id": "192" + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Interval", + "ref_id": "193" + } + ], + "ref_id": "194" + } + ], + "node_type": "Query", + "ref_id": "195" + } + ], + "node_type": "Query", + "ref_id": "195" + } + ], + "ref_id": "196" + } + ], + "define_name": "Hospitalization" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalAdmissionTime\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "162" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Hospitalization\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "163" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "197" + } + ], + "node_type": "Start", + "ref_id": "198" + } + ], + "node_type": "Start", + "ref_id": "198" + } + ], + "ref_id": "199" + } + ], + "define_name": "HospitalAdmissionTime" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalArrivalTime\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "200" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "First(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"HospitalizationLocations\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "201" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "202" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "202" + }, + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "203" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "204" + } + ], + "node_type": "Start", + "ref_id": "205" + } + ], + "ref_id": "206" + } + ], + "ref_id": "207" + } + ], + "ref_id": "208" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "ref_id": "209" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "210" + } + ], + "node_type": "Property", + "ref_id": "210" + } + ], + "node_type": "Start", + "ref_id": "211" + } + ], + "node_type": "Start", + "ref_id": "211" + } + ], + "ref_id": "212" + } + ], + "define_name": "HospitalArrivalTime" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalizationLengthofStay\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "215" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LengthInDays(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Hospitalization\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "216" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "217" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "218" + } + ], + "node_type": "FunctionRef", + "ref_id": "218" + } + ], + "ref_id": "219" + } + ], + "define_name": "HospitalizationLengthofStay" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalDepartureTime\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "220" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"HospitalizationLocations\"(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "221" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "222" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "FunctionRef", + "ref_id": "222" + }, + { + "children": [ + { + "text": "HospitalLocation" + } + ] + } + ], + "ref_id": "223" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "224" + } + ], + "node_type": "Start", + "ref_id": "225" + } + ], + "ref_id": "226" + } + ], + "ref_id": "227" + } + ], + "ref_id": "228" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "ref_id": "229" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "locationPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "230" + } + ], + "node_type": "Property", + "ref_id": "230" + } + ], + "node_type": "End", + "ref_id": "231" + } + ], + "node_type": "End", + "ref_id": "231" + } + ], + "ref_id": "232" + } + ], + "define_name": "HospitalDepartureTime" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalDischargeTime\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "233" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ], + "ref_id": "234" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "235" + } + ], + "node_type": "Property", + "ref_id": "235" + } + ], + "node_type": "End", + "ref_id": "236" + } + ], + "node_type": "End", + "ref_id": "236" + } + ], + "ref_id": "237" + } + ], + "define_name": "HospitalDischargeTime" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalizationWithObservationAndOutpatientSurgeryService\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "238" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "239" + }, + { + "children": [ + { + "text": " Visit" + } + ] + } + ], + "ref_id": "240" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "let " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ObsVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Observation Services\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "241" + } + ], + "node_type": "Retrieve", + "ref_id": "241" + }, + { + "children": [ + { + "text": " LastObs" + } + ] + } + ], + "ref_id": "242" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastObs" + } + ] + } + ], + "ref_id": "243" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "244" + } + ], + "node_type": "Property", + "ref_id": "244" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "248" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "249" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "245" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "246" + } + ], + "node_type": "Property", + "ref_id": "246" + } + ], + "node_type": "Start", + "ref_id": "247" + } + ], + "ref_id": "249" + } + ], + "ref_id": "249" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "250" + } + ], + "node_type": "End", + "ref_id": "251" + } + ], + "ref_id": "252" + } + ], + "ref_id": "253" + } + ], + "ref_id": "254" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "255" + } + ], + "ref_id": "256" + }, + { + "children": [ + { + "text": ",\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStart: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Coalesce(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "ObsVisit" + } + ] + } + ], + "ref_id": "257" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "258" + } + ], + "node_type": "Property", + "ref_id": "258" + } + ], + "node_type": "Start", + "ref_id": "259" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "260" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "261" + } + ], + "node_type": "Property", + "ref_id": "261" + } + ], + "node_type": "Start", + "ref_id": "262" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Coalesce", + "ref_id": "263" + } + ], + "ref_id": "264" + }, + { + "children": [ + { + "text": ",\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "EDVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Emergency Department Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "265" + } + ], + "node_type": "Retrieve", + "ref_id": "265" + }, + { + "children": [ + { + "text": " LastED" + } + ] + } + ], + "ref_id": "266" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastED" + } + ] + } + ], + "ref_id": "267" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "268" + } + ], + "node_type": "Property", + "ref_id": "268" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "270" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "271" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStart" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "269" + } + ], + "ref_id": "271" + } + ], + "ref_id": "271" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "272" + } + ], + "node_type": "End", + "ref_id": "273" + } + ], + "ref_id": "274" + } + ], + "ref_id": "275" + } + ], + "ref_id": "276" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "277" + } + ], + "ref_id": "278" + }, + { + "children": [ + { + "text": ",\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStartWithED: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Coalesce(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EDVisit" + } + ] + } + ], + "ref_id": "279" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "280" + } + ], + "node_type": "Property", + "ref_id": "280" + } + ], + "node_type": "Start", + "ref_id": "281" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStart" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "282" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Coalesce", + "ref_id": "283" + } + ], + "ref_id": "284" + }, + { + "children": [ + { + "text": ",\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "OutpatientSurgeryVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Outpatient Surgery Service\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "285" + } + ], + "node_type": "Retrieve", + "ref_id": "285" + }, + { + "children": [ + { + "text": " LastSurgeryOP" + } + ] + } + ], + "ref_id": "286" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastSurgeryOP" + } + ] + } + ], + "ref_id": "287" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "288" + } + ], + "node_type": "Property", + "ref_id": "288" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "290" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "291" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStartWithED" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "289" + } + ], + "ref_id": "291" + } + ], + "ref_id": "291" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "292" + } + ], + "node_type": "End", + "ref_id": "293" + } + ], + "ref_id": "294" + } + ], + "ref_id": "295" + } + ], + "ref_id": "296" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "297" + } + ], + "ref_id": "298" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "return " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval[" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Coalesce(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "OutpatientSurgeryVisit" + } + ] + } + ], + "ref_id": "299" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "300" + } + ], + "node_type": "Property", + "ref_id": "300" + } + ], + "node_type": "Start", + "ref_id": "301" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStartWithED" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "302" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "ref_id": "303" + }, + { + "children": [ + { + "text": ", \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "304" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "305" + } + ], + "node_type": "Property", + "ref_id": "305" + } + ], + "ref_id": "306" + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Interval", + "ref_id": "307" + } + ], + "ref_id": "308" + } + ], + "node_type": "Query", + "ref_id": "309" + } + ], + "node_type": "Query", + "ref_id": "309" + } + ], + "ref_id": "310" + } + ], + "define_name": "HospitalizationWithObservationAndOutpatientSurgeryService" + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "define function \"HospitalizationWithObservation\"(Encounter " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Encounter, Performed\"" + } + ] + } + ], + "ref_id": "311" + }, + { + "children": [ + { + "text": " ):\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Encounter" + } + ] + } + ] + } + ], + "node_type": "OperandRef", + "ref_id": "312" + }, + { + "children": [ + { + "text": " Visit" + } + ] + } + ], + "ref_id": "313" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "let " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ObsVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Observation Services\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "314" + } + ], + "node_type": "Retrieve", + "ref_id": "314" + }, + { + "children": [ + { + "text": " LastObs" + } + ] + } + ], + "ref_id": "315" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastObs" + } + ] + } + ], + "ref_id": "316" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "317" + } + ], + "node_type": "Property", + "ref_id": "317" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "321" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "322" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "318" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "319" + } + ], + "node_type": "Property", + "ref_id": "319" + } + ], + "node_type": "Start", + "ref_id": "320" + } + ], + "ref_id": "322" + } + ], + "ref_id": "322" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "323" + } + ], + "node_type": "End", + "ref_id": "324" + } + ], + "ref_id": "325" + } + ], + "ref_id": "326" + } + ], + "ref_id": "327" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "328" + } + ], + "ref_id": "329" + }, + { + "children": [ + { + "text": ",\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStart: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Coalesce(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "ObsVisit" + } + ] + } + ], + "ref_id": "330" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "331" + } + ], + "node_type": "Property", + "ref_id": "331" + } + ], + "node_type": "Start", + "ref_id": "332" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "333" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "334" + } + ], + "node_type": "Property", + "ref_id": "334" + } + ], + "node_type": "Start", + "ref_id": "335" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "node_type": "Coalesce", + "ref_id": "336" + } + ], + "ref_id": "337" + }, + { + "children": [ + { + "text": ",\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "EDVisit: " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Last(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "[\"Encounter, Performed\": " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "\"Emergency Department Visit\"" + } + ] + } + ] + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Retrieve", + "ref_id": "338" + } + ], + "node_type": "Retrieve", + "ref_id": "338" + }, + { + "children": [ + { + "text": " LastED" + } + ] + } + ], + "ref_id": "339" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "where " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "LastED" + } + ] + } + ], + "ref_id": "340" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "341" + } + ], + "node_type": "Property", + "ref_id": "341" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "ends " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "1 hour" + } + ] + } + ], + "node_type": "Quantity", + "ref_id": "343" + }, + { + "children": [ + { + "text": " or less on or before" + } + ] + } + ], + "ref_id": "344" + }, + { + "children": [ + { + "text": " " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStart" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "342" + } + ], + "ref_id": "344" + } + ], + "ref_id": "344" + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "sort by \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "IdentifierRef", + "ref_id": "345" + } + ], + "node_type": "End", + "ref_id": "346" + } + ], + "ref_id": "347" + } + ], + "ref_id": "348" + } + ], + "ref_id": "349" + }, + { + "children": [ + { + "text": "\n )" + } + ] + } + ], + "node_type": "Last", + "ref_id": "350" + } + ], + "ref_id": "351" + } + ] + }, + { + "children": [ + { + "text": "\n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "return " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Interval[" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "Coalesce(" + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "start of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "EDVisit" + } + ] + } + ], + "ref_id": "352" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "353" + } + ], + "node_type": "Property", + "ref_id": "353" + } + ], + "node_type": "Start", + "ref_id": "354" + }, + { + "children": [ + { + "text": ", " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "VisitStart" + } + ] + } + ], + "node_type": "QueryLetRef", + "ref_id": "355" + }, + { + "children": [ + { + "text": ")" + } + ] + } + ], + "ref_id": "356" + }, + { + "children": [ + { + "text": ", \n " + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "end of " + } + ] + }, + { + "children": [ + { + "children": [ + { + "children": [ + { + "text": "Visit" + } + ] + } + ], + "ref_id": "357" + }, + { + "children": [ + { + "text": "." + } + ] + }, + { + "children": [ + { + "children": [ + { + "text": "relevantPeriod" + } + ] + } + ], + "node_type": "Property", + "ref_id": "358" + } + ], + "node_type": "Property", + "ref_id": "358" + } + ], + "ref_id": "359" + }, + { + "children": [ + { + "text": "]" + } + ] + } + ], + "node_type": "Interval", + "ref_id": "360" + } + ], + "ref_id": "361" + } + ], + "node_type": "Query", + "ref_id": "362" + } + ], + "node_type": "Query", + "ref_id": "362" + } + ], + "ref_id": "363" + } + ], + "define_name": "HospitalizationWithObservation" + } + ], + "identifier": { + "id": "MATGlobalCommonFunctions", + "version": "4.0.000" + } + }, + "is_main_library": false, + "is_top_level": true, + "library_name": "MATGlobalCommonFunctions", + "library_version": "4.0.000", + "statement_dependencies": [ + { + "_id": "6500d365e77bbf53b55d21c1", + "statement_name": "CalendarAgeInYearsAt", + "statement_references": [ + { + "_id": "6500d365e77bbf53b55d21c2", + "hqmf_id": null, + "library_name": "MATGlobalCommonFunctions", + "statement_name": "ToDate" + } + ] + }, + { + "_id": "6500d365e77bbf53b55d21c3", + "statement_name": "ToDate" + } + ] + } + ], + "created_at": "2023-09-12T21:08:53.110Z", + "description": "The percentage of patients 18-75 years of age with diabetes who had a nephropathy screening test or evidence of nephropathy during the measurement period", + "group_id": "501fdba3044a111b98000001", + "hqmf_id": "40280382-6963-BF5E-0169-DA49F1E93882", + "hqmf_set_id": "7B2A9277-43DA-4D99-9BEE-6AC271A07747", + "hqmf_version_number": "8.4.000", + "main_cql_library": "DiabetesMedicalAttentionforNephropathy", + "measure_attributes": [ + { + "code": "OTH", + "value": "134", + "name": "eCQM Identifier (Measure Authoring Tool)", + "code_obj": { + "type": "CD", + "null_flavor": "OTH", + "original_text": "eCQM Identifier (Measure Authoring Tool)" + }, + "value_obj": { + "type": "ED", + "value": "134", + "media_type": "text/plain" + } + }, + { + "code": "OTH", + "value": "Not Applicable", + "name": "NQF Number", + "code_obj": { + "type": "CD", + "null_flavor": "OTH", + "original_text": "NQF Number" + }, + "value_obj": { + "type": "ED", + "value": "Not Applicable", + "media_type": "text/plain" + } + }, + { + "code": "COPY", + "value": "This Physician Performance Measure (Measure) and related data specifications are owned and were developed by the National Committee for Quality Assurance (NCQA). NCQA is not responsible for any use of the Measure. NCQA makes no representations, warranties, or endorsement about the quality of any organization or physician that uses or reports performance measures and NCQA has no liability to anyone who relies on such measures or specifications. NCQA holds a copyright in the Measure. The Measure can be reproduced and distributed, without modification, for noncommercial purposes (e.g., use by healthcare providers in connection with their practices) without obtaining approval from NCQA. Commercial use is defined as the sale, licensing, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain. All commercial uses or requests for modification must be approved by NCQA and are subject to a license at the discretion of NCQA. (C) 2012-2019 National Committee for Quality Assurance. All Rights Reserved. \nLimited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. NCQA disclaims all liability for use or accuracy of any third party codes contained in the specifications.\nCPT(R) contained in the Measure specifications is copyright 2004-2018 American Medical Association. LOINC(R) copyright 2004-2018 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2018 International Health Terminology Standards Development Organisation. ICD-10 copyright 2018 World Health Organization. All Rights Reserved.", + "name": "Copyright", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "COPY", + "title": "Copyright" + }, + "value_obj": { + "type": "ED", + "value": "This Physician Performance Measure (Measure) and related data specifications are owned and were developed by the National Committee for Quality Assurance (NCQA). NCQA is not responsible for any use of the Measure. NCQA makes no representations, warranties, or endorsement about the quality of any organization or physician that uses or reports performance measures and NCQA has no liability to anyone who relies on such measures or specifications. NCQA holds a copyright in the Measure. The Measure can be reproduced and distributed, without modification, for noncommercial purposes (e.g., use by healthcare providers in connection with their practices) without obtaining approval from NCQA. Commercial use is defined as the sale, licensing, or distribution of the Measure for commercial gain, or incorporation of the Measure into a product or service that is sold, licensed or distributed for commercial gain. All commercial uses or requests for modification must be approved by NCQA and are subject to a license at the discretion of NCQA. (C) 2012-2019 National Committee for Quality Assurance. All Rights Reserved. \nLimited proprietary coding is contained in the Measure specifications for user convenience. Users of proprietary code sets should obtain all necessary licenses from the owners of the code sets. NCQA disclaims all liability for use or accuracy of any third party codes contained in the specifications.\nCPT(R) contained in the Measure specifications is copyright 2004-2018 American Medical Association. LOINC(R) copyright 2004-2018 Regenstrief Institute, Inc. This material contains SNOMED Clinical Terms(R) (SNOMED CT[R]) copyright 2004-2018 International Health Terminology Standards Development Organisation. ICD-10 copyright 2018 World Health Organization. All Rights Reserved.", + "media_type": "text/plain" + } + }, + { + "code": "DISC", + "value": "The performance Measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE AND SPECIFICATIONS ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND.\nDue to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].", + "name": "Disclaimer", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "DISC", + "title": "Disclaimer" + }, + "value_obj": { + "type": "ED", + "value": "The performance Measure is not a clinical guideline and does not establish a standard of medical care, and has not been tested for all potential applications. THE MEASURE AND SPECIFICATIONS ARE PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND.\nDue to technical limitations, registered trademarks are indicated by (R) or [R] and unregistered trademarks are indicated by (TM) or [TM].", + "media_type": "text/plain" + } + }, + { + "code": "MSRSCORE", + "name": "Measure Scoring", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "MSRSCORE", + "title": "Measure Scoring" + }, + "value_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.1063", + "code": "PROPOR", + "title": "Proportion" + } + }, + { + "code": "MSRTYPE", + "name": "Measure Type", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "MSRTYPE", + "title": "Measure Type" + }, + "value_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.1063", + "code": "PROCESS", + "title": "PROCESS" + } + }, + { + "code": "STRAT", + "value": "None", + "name": "Stratification", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "STRAT", + "title": "Stratification" + }, + "value_obj": { + "type": "ED", + "value": "None", + "media_type": "text/plain" + } + }, + { + "code": "MSRADJ", + "value": "None", + "name": "Risk Adjustment", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "MSRADJ", + "title": "Risk Adjustment" + }, + "value_obj": { + "type": "ED", + "value": "None", + "media_type": "text/plain" + } + }, + { + "code": "MSRAGG", + "value": "None", + "name": "Rate Aggregation", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "MSRAGG", + "title": "Rate Aggregation" + }, + "value_obj": { + "type": "ED", + "value": "None", + "media_type": "text/plain" + } + }, + { + "code": "RAT", + "value": "As the seventh leading cause of death in the U.S., diabetes kills approximately 79,500 people a year and affects more than 30 million Americans (9.4 percent of the U.S. population) (CDC, 2017a, 2017b). Diabetes is a long-lasting disease marked by high blood glucose levels, resulting from the body's inability to produce or use insulin properly (CDC, 2017c). People with diabetes are at increased risk of serious health complications including vision loss, heart disease, stroke, kidney failure, amputation of toes, feet or legs, and premature death. (CDC, 2016). \n\nIn 2017, diabetes cost the U.S. an estimated $327 billion: $237 billion in direct medical costs and $90 billion in reduced productivity. This is a 34 percent increase from the estimated $245 billion spent on diabetes in 2012 (American Diabetes Association, 2018a). \n\nHigh blood sugar levels in patients with diabetes put them at a higher risk of damaging their kidneys and causing chronic kidney disease, which can lead to kidney failure (CDC, 2016, 2017d). During 2011-2012 there were 36.5% new cases of chronic kidney disease (stages 1-4) among 297,000 diabetic patients 20 years and older (Murphy et al., 2016). In 2014, diabetes accounted for 44% of 118,000 new cases of end stage renal disease (United States Renal Data System, 2016).", + "name": "Rationale", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "RAT", + "title": "Rationale" + }, + "value_obj": { + "type": "ED", + "value": "As the seventh leading cause of death in the U.S., diabetes kills approximately 79,500 people a year and affects more than 30 million Americans (9.4 percent of the U.S. population) (CDC, 2017a, 2017b). Diabetes is a long-lasting disease marked by high blood glucose levels, resulting from the body's inability to produce or use insulin properly (CDC, 2017c). People with diabetes are at increased risk of serious health complications including vision loss, heart disease, stroke, kidney failure, amputation of toes, feet or legs, and premature death. (CDC, 2016). \n\nIn 2017, diabetes cost the U.S. an estimated $327 billion: $237 billion in direct medical costs and $90 billion in reduced productivity. This is a 34 percent increase from the estimated $245 billion spent on diabetes in 2012 (American Diabetes Association, 2018a). \n\nHigh blood sugar levels in patients with diabetes put them at a higher risk of damaging their kidneys and causing chronic kidney disease, which can lead to kidney failure (CDC, 2016, 2017d). During 2011-2012 there were 36.5% new cases of chronic kidney disease (stages 1-4) among 297,000 diabetic patients 20 years and older (Murphy et al., 2016). In 2014, diabetes accounted for 44% of 118,000 new cases of end stage renal disease (United States Renal Data System, 2016).", + "media_type": "text/plain" + } + }, + { + "code": "CRS", + "value": "American Diabetes Association (2018b ):\n\nScreening\n- At least once a year, assess urinary albumin (e.g., spot urinary albumin-to-creatinine ratio [UACR]) and estimated glomerular filtration rate (eGFR) in patients with type 1 diabetes duration of greater than or equal to 5 years in all patients with type 2 diabetes, and in all patients with comorbid hypertension. (Level of evidence: B)\n\nTreatment\n- An angiotensin-converting enzyme (ACE) inhibitor or angiotensin receptor blocker (ARB) is not recommended for the primary prevention of diabetic kidney disease in patients with diabetes who have normal blood pressure, normal UACR (<30 mg/g creatinine), and normal estimated glomerular filtration rate. (Level of evidence: B)\n- Either an ACE inhibitor or ARB is suggested for the treatment of the nonpregnant patient with modestly elevated UACR (30-299 mg/g creatinine) (Level of evidence: B) and is strongly recommended for those with urinary albumin to creatinine ratio >=300 mg/g creatinine and/or estimated glomerular filtration rate < 60 mL/min/1.73.m2. (Level of evidence: A)\n- Periodically monitor serum creatinine and potassium levels for the development of increased creatinine or changes in potassium when ACE inhibitors, angiotensin receptor blockers, or diuretics are used. (Level of evidence: B) \n- Continued monitoring of UACR in patients with albuminuria treated with an ACE inhibitor or ARBs is reasonable to assess the response to treatment and progression of diabetic kidney disease. (Level of evidence: E)\n- When estimated glomerular filtration rate is <60 mL/min/1.73 m2, evaluate and manage potential complications of chronic kidney disease. (Level of evidence: E) \n-Patients should be referred for evaluation for renal replacement treatment if they have an estimated glomerular filtration rate <30 mL/min/1.73 m2. (Level of evidence: A) \n-Promptly refer to a physician experienced in the care of kidney disease for uncertainty about the etiology of kidney disease, difficult management issues, and rapidly progressing kidney disease. (Level of evidence: B) \n\nAmerican Association of Clinical Endocrinologists & American College of Endocrinology (2015): \n- Beginning 5 years after diagnosis in patients with type 1 diabetes (if diagnosed before age 30) or at diagnosis in patients with type 2 diabetes and those with type 1 diabetes diagnosed after age 30, annual assessment of serum creatinine to determine the estimated glomerular filtration rate (eGFR) and urine albumin excretion rate (AER) should be performed to identify, stage, and monitor progression of diabetic nephropathy (Grade C; best evidence level 3). \n- Patients with nephropathy should be counseled regarding the need for optimal glycemic control, blood pressure control, dyslipidemia control, and smoking cessation (Grade B; best evidence level 2). \n- In addition, they should have routine monitoring of albuminuria, kidney function electrolytes, and lipids (Grade B; best evidence level 2). \n- Associated conditions such as anemia and bone and mineral disorders should be assessed as kidney function declines (Grade D; best evidence level 4). \n- Referral to a nephrologist is recommended well before the need for renal replacement therapy (Grade D; best evidence level 4).", + "name": "Clinical Recommendation Statement", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "CRS", + "title": "Clinical Recommendation Statement" + }, + "value_obj": { + "type": "ED", + "value": "American Diabetes Association (2018b ):\n\nScreening\n- At least once a year, assess urinary albumin (e.g., spot urinary albumin-to-creatinine ratio [UACR]) and estimated glomerular filtration rate (eGFR) in patients with type 1 diabetes duration of greater than or equal to 5 years in all patients with type 2 diabetes, and in all patients with comorbid hypertension. (Level of evidence: B)\n\nTreatment\n- An angiotensin-converting enzyme (ACE) inhibitor or angiotensin receptor blocker (ARB) is not recommended for the primary prevention of diabetic kidney disease in patients with diabetes who have normal blood pressure, normal UACR (<30 mg/g creatinine), and normal estimated glomerular filtration rate. (Level of evidence: B)\n- Either an ACE inhibitor or ARB is suggested for the treatment of the nonpregnant patient with modestly elevated UACR (30-299 mg/g creatinine) (Level of evidence: B) and is strongly recommended for those with urinary albumin to creatinine ratio >=300 mg/g creatinine and/or estimated glomerular filtration rate < 60 mL/min/1.73.m2. (Level of evidence: A)\n- Periodically monitor serum creatinine and potassium levels for the development of increased creatinine or changes in potassium when ACE inhibitors, angiotensin receptor blockers, or diuretics are used. (Level of evidence: B) \n- Continued monitoring of UACR in patients with albuminuria treated with an ACE inhibitor or ARBs is reasonable to assess the response to treatment and progression of diabetic kidney disease. (Level of evidence: E)\n- When estimated glomerular filtration rate is <60 mL/min/1.73 m2, evaluate and manage potential complications of chronic kidney disease. (Level of evidence: E) \n-Patients should be referred for evaluation for renal replacement treatment if they have an estimated glomerular filtration rate <30 mL/min/1.73 m2. (Level of evidence: A) \n-Promptly refer to a physician experienced in the care of kidney disease for uncertainty about the etiology of kidney disease, difficult management issues, and rapidly progressing kidney disease. (Level of evidence: B) \n\nAmerican Association of Clinical Endocrinologists & American College of Endocrinology (2015): \n- Beginning 5 years after diagnosis in patients with type 1 diabetes (if diagnosed before age 30) or at diagnosis in patients with type 2 diabetes and those with type 1 diabetes diagnosed after age 30, annual assessment of serum creatinine to determine the estimated glomerular filtration rate (eGFR) and urine albumin excretion rate (AER) should be performed to identify, stage, and monitor progression of diabetic nephropathy (Grade C; best evidence level 3). \n- Patients with nephropathy should be counseled regarding the need for optimal glycemic control, blood pressure control, dyslipidemia control, and smoking cessation (Grade B; best evidence level 2). \n- In addition, they should have routine monitoring of albuminuria, kidney function electrolytes, and lipids (Grade B; best evidence level 2). \n- Associated conditions such as anemia and bone and mineral disorders should be assessed as kidney function declines (Grade D; best evidence level 4). \n- Referral to a nephrologist is recommended well before the need for renal replacement therapy (Grade D; best evidence level 4).", + "media_type": "text/plain" + } + }, + { + "code": "IDUR", + "value": "Higher score indicates better quality", + "name": "Improvement Notation", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "IDUR", + "title": "Improvement Notation" + }, + "value_obj": { + "type": "ED", + "value": "Higher score indicates better quality", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "American Association of Clinical Endocrinologists & American College of Endocrinology. (2015). Clinical practice guidelines for developing a diabetes mellitus comprehensive care plan—2015. Endocrine Practice, 21(Suppl. 1). Retrieved from https://www.aace.com/files/dm-guidelines-ccp.pdf", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "American Association of Clinical Endocrinologists & American College of Endocrinology. (2015). Clinical practice guidelines for developing a diabetes mellitus comprehensive care plan—2015. Endocrine Practice, 21(Suppl. 1). Retrieved from https://www.aace.com/files/dm-guidelines-ccp.pdf", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "American Diabetes Association. (2018a). Economic costs of diabetes in the U.S. in 2017. Diabetes Care, 41, 917-928. Retrieved from http://care.diabetesjournals.org/content/early/2018/03/20/dci18-0007", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "American Diabetes Association. (2018a). Economic costs of diabetes in the U.S. in 2017. Diabetes Care, 41, 917-928. Retrieved from http://care.diabetesjournals.org/content/early/2018/03/20/dci18-0007", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "American Diabetes Association. (2018b). 10. Microvascular complications and foot care: Standards of Medical Care in Diabetes—2018. Diabetes Care, 41(Suppl. 1), S105-S118.", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "American Diabetes Association. (2018b). 10. Microvascular complications and foot care: Standards of Medical Care in Diabetes—2018. Diabetes Care, 41(Suppl. 1), S105-S118.", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "Centers for Disease Control and Prevention. (2016). At a glance 2016: Diabetes—Working to reverse the U.S. epidemic. Atlanta, GA: Author.", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "Centers for Disease Control and Prevention. (2016). At a glance 2016: Diabetes—Working to reverse the U.S. epidemic. Atlanta, GA: Author.", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "Centers for Disease Control and Prevention. (2017a). Health, United States, 2016: With chartbook on long-term trends in health. Retrieved from https://www.cdc.gov/nchs/data/hus/hus16.pdf", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "Centers for Disease Control and Prevention. (2017a). Health, United States, 2016: With chartbook on long-term trends in health. Retrieved from https://www.cdc.gov/nchs/data/hus/hus16.pdf", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "Centers for Disease Control and Prevention. (2017b). National diabetes statistics report, 2017. Atlanta, GA: U.S. Department of Health and Human Services, CDC. Retrieved from https://www.cdc.gov/diabetes/pdfs/data/statistics/national-diabetes-statistics-report.pdf", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "Centers for Disease Control and Prevention. (2017b). National diabetes statistics report, 2017. Atlanta, GA: U.S. Department of Health and Human Services, CDC. Retrieved from https://www.cdc.gov/diabetes/pdfs/data/statistics/national-diabetes-statistics-report.pdf", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "Centers for Disease Control and Prevention. (2017c). About diabetes. Retrieved from https://www.cdc.gov/diabetes/basics/diabetes.html", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "Centers for Disease Control and Prevention. (2017c). About diabetes. Retrieved from https://www.cdc.gov/diabetes/basics/diabetes.html", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "Centers for Disease Control and Prevention. (2017d). National chronic kidney disease fact sheet. Retrieved from https://www.cdc.gov/diabetes/pubs/pdf/kidney_factsheet.pdf", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "Centers for Disease Control and Prevention. (2017d). National chronic kidney disease fact sheet. Retrieved from https://www.cdc.gov/diabetes/pubs/pdf/kidney_factsheet.pdf", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "Murphy, D., McCulloch, C. E., Lin, F., et al. (2016). Trends in prevalence of chronic kidney disease in the United States. Annals of Internal Medicine, 165(7), 473-481.", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "Murphy, D., McCulloch, C. E., Lin, F., et al. (2016). Trends in prevalence of chronic kidney disease in the United States. Annals of Internal Medicine, 165(7), 473-481.", + "media_type": "text/plain" + } + }, + { + "code": "REF", + "value": "United States Renal Data System. (2016). 2016 USRDS annual data report: Epidemiology of kidney disease in the United States. Bethesda, MD: National Institute of Diabetes and Digestive and Kidney Diseases, National Institutes of Health.", + "name": "Reference", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "REF", + "title": "Reference" + }, + "value_obj": { + "type": "ED", + "value": "United States Renal Data System. (2016). 2016 USRDS annual data report: Epidemiology of kidney disease in the United States. Bethesda, MD: National Institute of Diabetes and Digestive and Kidney Diseases, National Institutes of Health.", + "media_type": "text/plain" + } + }, + { + "code": "DEF", + "value": "None", + "name": "Definition", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "DEF", + "title": "Definition" + }, + "value_obj": { + "type": "ED", + "value": "None", + "media_type": "text/plain" + } + }, + { + "code": "GUIDE", + "value": "Only patients with a diagnosis of Type 1 or Type 2 diabetes should be included in the denominator of this measure; patients with a diagnosis of secondary diabetes due to another condition should not be included", + "name": "Guidance", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "GUIDE", + "title": "Guidance" + }, + "value_obj": { + "type": "ED", + "value": "Only patients with a diagnosis of Type 1 or Type 2 diabetes should be included in the denominator of this measure; patients with a diagnosis of secondary diabetes due to another condition should not be included", + "media_type": "text/plain" + } + }, + { + "code": "TRANF", + "value": "TBD", + "name": "Transmission Format", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "TRANF", + "title": "Transmission Format" + }, + "value_obj": { + "type": "ED", + "value": "TBD", + "media_type": "text/plain" + } + }, + { + "code": "IPOP", + "value": "Patients 18-75 years of age with diabetes with a visit during the measurement period", + "name": "Initial Population", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "IPOP", + "title": "Initial Population" + }, + "value_obj": { + "type": "ED", + "value": "Patients 18-75 years of age with diabetes with a visit during the measurement period", + "media_type": "text/plain" + } + }, + { + "code": "DENOM", + "value": "Equals Initial Population", + "name": "Denominator", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "DENOM", + "title": "Denominator" + }, + "value_obj": { + "type": "ED", + "value": "Equals Initial Population", + "media_type": "text/plain" + } + }, + { + "code": "DENEX", + "value": "Exclude patients whose hospice care overlaps the measurement period.\n\nExclude patients 66 and older who are living long term in an institution for more than 90 days during the measurement period. \n\nExclude patients 66 and older with advanced illness and frailty because it is unlikely that patients will benefit from the services being measured.", + "name": "Denominator Exclusions", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "DENEX", + "title": "Denominator Exclusions" + }, + "value_obj": { + "type": "ED", + "value": "Exclude patients whose hospice care overlaps the measurement period.\n\nExclude patients 66 and older who are living long term in an institution for more than 90 days during the measurement period. \n\nExclude patients 66 and older with advanced illness and frailty because it is unlikely that patients will benefit from the services being measured.", + "media_type": "text/plain" + } + }, + { + "code": "NUMER", + "value": "Patients with a screening for nephropathy or evidence of nephropathy during the measurement period", + "name": "Numerator", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "NUMER", + "title": "Numerator" + }, + "value_obj": { + "type": "ED", + "value": "Patients with a screening for nephropathy or evidence of nephropathy during the measurement period", + "media_type": "text/plain" + } + }, + { + "code": "NUMEX", + "value": "Not Applicable", + "name": "Numerator Exclusions", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "NUMEX", + "title": "Numerator Exclusions" + }, + "value_obj": { + "type": "ED", + "value": "Not Applicable", + "media_type": "text/plain" + } + }, + { + "code": "DENEXCEP", + "value": "None", + "name": "Denominator Exceptions", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "DENEXCEP", + "title": "Denominator Exceptions" + }, + "value_obj": { + "type": "ED", + "value": "None", + "media_type": "text/plain" + } + }, + { + "code": "SDE", + "value": "For every patient evaluated by this measure also identify payer, race, ethnicity and sex", + "name": "Supplemental Data Elements", + "code_obj": { + "type": "CD", + "system": "2.16.840.1.113883.5.4", + "code": "SDE", + "title": "Supplemental Data Elements" + }, + "value_obj": { + "type": "ED", + "value": "For every patient evaluated by this measure also identify payer, race, ethnicity and sex", + "media_type": "text/plain" + } + } + ], + "measure_period": { + "type": "IVL_TS", + "low": { + "type": "TS", + "value": "201201010000", + "inclusive?": true, + "derived?": false + }, + "high": { + "type": "TS", + "value": "201212312359", + "inclusive?": true, + "derived?": false + }, + "width": { + "type": "PQ", + "unit": "a", + "value": "1", + "inclusive?": true, + "derived?": false + } + }, + "measure_scoring": "PROPORTION", + "patient_ids": null, + "population_criteria": { + "IPP": { + "conjunction?": true, + "type": "IPP", + "hqmf_id": "C2A0B8D4-8026-4A7A-B635-9D87BA320600", + "preconditions": [ + { + "id": 2, + "preconditions": [ + { + "id": 1, + "reference": "DiabetesMedicalAttentionforNephropathy__Initial_Population__8457AE3D_C726_4D1A_B203_5DC8A758883F" + } + ], + "conjunction_code": "allTrue" + } + ] + }, + "DENOM": { + "conjunction?": true, + "type": "DENOM", + "hqmf_id": "93A01D6E-ABC7-420C-85E0-2C8E34C6368B", + "preconditions": [ + { + "id": 4, + "preconditions": [ + { + "id": 3, + "reference": "DiabetesMedicalAttentionforNephropathy__Denominator__8457AE3D_C726_4D1A_B203_5DC8A758883F" + } + ], + "conjunction_code": "allTrue" + } + ] + }, + "NUMER": { + "conjunction?": true, + "type": "NUMER", + "hqmf_id": "7F90D098-A158-45A4-A2E6-DF7E2E75F83E", + "preconditions": [ + { + "id": 6, + "preconditions": [ + { + "id": 5, + "reference": "DiabetesMedicalAttentionforNephropathy__Numerator__8457AE3D_C726_4D1A_B203_5DC8A758883F" + } + ], + "conjunction_code": "allTrue" + } + ] + }, + "DENEX": { + "conjunction?": true, + "type": "DENEX", + "hqmf_id": "559CE8DF-4CA4-4FC5-9439-76EE307037DF", + "preconditions": [ + { + "id": 8, + "preconditions": [ + { + "id": 7, + "reference": "DiabetesMedicalAttentionforNephropathy__Denominator_Exclusions__8457AE3D_C726_4D1A_B203_5DC8A758883F" + } + ], + "conjunction_code": "atLeastOneTrue" + } + ] + } + }, + "population_sets": [ + { + "_id": "6500d365e77bbf53b55d21ec", + "population_set_id": "PopulationSet_1", + "populations": { + "DENEX": { + "_id": "6500d365e77bbf53b55d21f0", + "hqmf_id": "559CE8DF-4CA4-4FC5-9439-76EE307037DF", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Denominator Exclusions" + }, + "DENOM": { + "_id": "6500d365e77bbf53b55d21ef", + "hqmf_id": "93A01D6E-ABC7-420C-85E0-2C8E34C6368B", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Denominator" + }, + "IPP": { + "_id": "6500d365e77bbf53b55d21ee", + "hqmf_id": "C2A0B8D4-8026-4A7A-B635-9D87BA320600", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Initial Population" + }, + "NUMER": { + "_id": "6500d365e77bbf53b55d21f1", + "hqmf_id": "7F90D098-A158-45A4-A2E6-DF7E2E75F83E", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "Numerator" + }, + "_id": "6500d365e77bbf53b55d21ed" + }, + "supplemental_data_elements": [ + { + "_id": "6500d365e77bbf53b55d21f2", + "hqmf_id": "89549C60-2D86-477A-AFA1-7392533FFA95", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "SDE Ethnicity" + }, + { + "_id": "6500d365e77bbf53b55d21f3", + "hqmf_id": "EF20A740-AEB3-443A-9A42-718D83527119", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "SDE Payer" + }, + { + "_id": "6500d365e77bbf53b55d21f4", + "hqmf_id": "8CF71934-E1F8-4F20-B767-75ED9FA250D1", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "SDE Race" + }, + { + "_id": "6500d365e77bbf53b55d21f5", + "hqmf_id": "9396A2AE-C8C4-43F2-8153-A407F13ACC75", + "library_name": "DiabetesMedicalAttentionforNephropathy", + "statement_name": "SDE Sex" + } + ], + "title": "Population Criteria Section" + } + ], + "source_data_criteria": [ + { + "_id": "6500d365e77bbf53b55d21c4", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.666.5.307", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: EncounterInpatient", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21c4", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21c5", + "codeListId": "2.16.840.1.113883.3.464.1003.113.12.1075", + "dataElementCodes": [ + + ], + "description": "Symptom: FrailtySymptom", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.116", + "id": "6500d365e77bbf53b55d21c5", + "prevalencePeriod": null, + "qdmCategory": "symptom", + "qdmTitle": "Symptom", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.136", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21c6", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1013", + "components": null, + "dataElementCodes": [ + + ], + "description": "Procedure, Performed: DialysisServices", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.67", + "id": "6500d365e77bbf53b55d21c6", + "incisionDatetime": null, + "method": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "procedure", + "qdmStatus": "performed", + "qdmTitle": "Procedure, Performed", + "qdmVersion": "5.5", + "rank": null, + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21c7", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1014", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: CareServicesinLong-TermResidentialFacility", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21c7", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21c8", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1012", + "components": null, + "dataElementCodes": [ + + ], + "description": "Procedure, Performed: KidneyTransplant", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.67", + "id": "6500d365e77bbf53b55d21c8", + "incisionDatetime": null, + "method": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "procedure", + "qdmStatus": "performed", + "qdmTitle": "Procedure, Performed", + "qdmVersion": "5.5", + "rank": null, + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21c9", + "codeListId": "2.16.840.1.113762.1.4.1", + "dataElementCodes": [ + + ], + "description": "Patient Characteristic Sex: ONCAdministrativeSex", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.55", + "id": "6500d365e77bbf53b55d21c9", + "qdmCategory": "patient_characteristic", + "qdmStatus": "gender", + "qdmTitle": "Patient Characteristic Sex", + "qdmVersion": "5.5" + }, + { + "_id": "6500d365e77bbf53b55d21ca", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1014", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: ESRDMonthlyOutpatientServices", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21ca", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21cb", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1023", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: PreventiveCareServices-InitialOfficeVisit18andUp", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21cb", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21cc", + "codeListId": "2.16.840.1.113883.3.526.3.1139", + "dataElementCodes": [ + + ], + "description": "Medication, Active: ACEInhibitororARB", + "dosage": null, + "frequency": null, + "hqmfOid": "2.16.840.1.113883.10.20.28.4.44", + "id": "6500d365e77bbf53b55d21cc", + "qdmCategory": "medication", + "qdmStatus": "active", + "qdmTitle": "Medication, Active", + "qdmVersion": "5.5", + "relevantDatetime": null, + "relevantPeriod": null, + "route": null + }, + { + "_id": "6500d365e77bbf53b55d21cd", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1084", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: NonacuteInpatient", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21cd", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21ce", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1028", + "dataElementCodes": [ + + ], + "description": "Diagnosis: KidneyFailure", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21ce", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21cf", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1004", + "dataElementCodes": [ + + ], + "description": "Diagnosis: DiabeticNephropathy", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21cf", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21d0", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1012", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: NursingFacilityVisit", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21d0", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21d1", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1025", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: PreventiveCareServices-EstablishedOfficeVisit18andUp", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21d1", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21d2", + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1015", + "dataElementCodes": [ + + ], + "description": "Intervention, Performed: OtherServicesRelatedtoDialysis", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.36", + "id": "6500d365e77bbf53b55d21d2", + "negationRationale": null, + "qdmCategory": "intervention", + "qdmStatus": "performed", + "qdmTitle": "Intervention, Performed", + "qdmVersion": "5.5", + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21d3", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.526.3.1240", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: AnnualWellnessVisit", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21d3", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21d4", + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.118.12.1300", + "dataElementCodes": [ + + ], + "description": "Device, Order: FrailtyDevice", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.15", + "id": "6500d365e77bbf53b55d21d4", + "negationRationale": null, + "qdmCategory": "device", + "qdmStatus": "order", + "qdmTitle": "Device, Order", + "qdmVersion": "5.5", + "reason": null + }, + { + "_id": "6500d365e77bbf53b55d21d5", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.118.12.1300", + "dataElementCodes": [ + + ], + "description": "Device, Applied: FrailtyDevice", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.13", + "id": "6500d365e77bbf53b55d21d5", + "negationRationale": null, + "qdmCategory": "device", + "qdmStatus": "applied", + "qdmTitle": "Device, Applied", + "qdmVersion": "5.5", + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21d6", + "codeListId": "2.16.840.1.114222.4.11.836", + "dataElementCodes": [ + + ], + "description": "Patient Characteristic Race: Race", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.59", + "id": "6500d365e77bbf53b55d21d6", + "qdmCategory": "patient_characteristic", + "qdmStatus": "race", + "qdmTitle": "Patient Characteristic Race", + "qdmVersion": "5.5" + }, + { + "_id": "6500d365e77bbf53b55d21d7", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1086", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: Observation", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21d7", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21d8", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1085", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: ED", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21d8", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21d9", + "codeListId": "2.16.840.1.113883.3.464.1003.196.12.1510", + "dataElementCodes": [ + + ], + "description": "Medication, Active: DementiaMedications", + "dosage": null, + "frequency": null, + "hqmfOid": "2.16.840.1.113883.10.20.28.4.44", + "id": "6500d365e77bbf53b55d21d9", + "qdmCategory": "medication", + "qdmStatus": "active", + "qdmTitle": "Medication, Active", + "qdmVersion": "5.5", + "relevantDatetime": null, + "relevantPeriod": null, + "route": null + }, + { + "_id": "6500d365e77bbf53b55d21da", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1001", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: OfficeVisit", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21da", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21db", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1017", + "dataElementCodes": [ + + ], + "description": "Diagnosis: HypertensiveChronicKidneyDisease", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21db", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21dc", + "codeListId": "2.16.840.1.114222.4.11.3591", + "dataElementCodes": [ + + ], + "description": "Patient Characteristic Payer: Payer", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.58", + "id": "6500d365e77bbf53b55d21dc", + "qdmCategory": "patient_characteristic", + "qdmStatus": "payer", + "qdmTitle": "Patient Characteristic Payer", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21dd", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1083", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: AcuteInpatient", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21dd", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21de", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1018", + "dataElementCodes": [ + + ], + "description": "Diagnosis: GlomerulonephritisandNephroticSyndrome", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21de", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21df", + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1016", + "dataElementCodes": [ + + ], + "description": "Intervention, Performed: DialysisEducation", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.36", + "id": "6500d365e77bbf53b55d21df", + "negationRationale": null, + "qdmCategory": "intervention", + "qdmStatus": "performed", + "qdmTitle": "Intervention, Performed", + "qdmVersion": "5.5", + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21e0", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1087", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: Outpatient", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21e0", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21e1", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1011", + "components": null, + "dataElementCodes": [ + + ], + "description": "Procedure, Performed: VascularAccessforDialysis", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.67", + "id": "6500d365e77bbf53b55d21e1", + "incisionDatetime": null, + "method": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "procedure", + "qdmStatus": "performed", + "qdmTitle": "Procedure, Performed", + "qdmVersion": "5.5", + "rank": null, + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21e2", + "authorDatetime": null, + "codeListId": "2.16.840.1.113762.1.4.1108.15", + "dataElementCodes": [ + + ], + "description": "Intervention, Order: Hospicecareambulatory", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.35", + "id": "6500d365e77bbf53b55d21e2", + "negationRationale": null, + "qdmCategory": "intervention", + "qdmStatus": "order", + "qdmTitle": "Intervention, Order", + "qdmVersion": "5.5", + "reason": null + }, + { + "_id": "6500d365e77bbf53b55d21e3", + "authorDatetime": null, + "codeListId": "2.16.840.1.113762.1.4.1108.15", + "dataElementCodes": [ + + ], + "description": "Intervention, Performed: Hospicecareambulatory", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.36", + "id": "6500d365e77bbf53b55d21e3", + "negationRationale": null, + "qdmCategory": "intervention", + "qdmStatus": "performed", + "qdmTitle": "Intervention, Performed", + "qdmVersion": "5.5", + "reason": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21e4", + "codeListId": "2.16.840.1.114222.4.11.837", + "dataElementCodes": [ + + ], + "description": "Patient Characteristic Ethnicity: Ethnicity", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.56", + "id": "6500d365e77bbf53b55d21e4", + "qdmCategory": "patient_characteristic", + "qdmStatus": "ethnicity", + "qdmTitle": "Patient Characteristic Ethnicity", + "qdmVersion": "5.5" + }, + { + "_id": "6500d365e77bbf53b55d21e5", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1088", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: FrailtyEncounter", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21e5", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21e6", + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.109.12.1024", + "components": null, + "dataElementCodes": [ + + ], + "description": "Laboratory Test, Performed: UrineProteinTests", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.42", + "id": "6500d365e77bbf53b55d21e6", + "method": null, + "negationRationale": null, + "qdmCategory": "laboratory_test", + "qdmStatus": "performed", + "qdmTitle": "Laboratory Test, Performed", + "qdmVersion": "5.5", + "reason": null, + "referenceRange": null, + "relevantDatetime": null, + "relevantPeriod": null, + "result": null, + "resultDatetime": null, + "status": null + }, + { + "_id": "6500d365e77bbf53b55d21e7", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.103.12.1001", + "dataElementCodes": [ + + ], + "description": "Diagnosis: Diabetes", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21e7", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21e8", + "admissionSource": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.101.12.1016", + "dataElementCodes": [ + + ], + "description": "Encounter, Performed: HomeHealthcareServices", + "diagnoses": null, + "dischargeDisposition": null, + "facilityLocations": [ + + ], + "hqmfOid": "2.16.840.1.113883.10.20.28.4.5", + "id": "6500d365e77bbf53b55d21e8", + "lengthOfStay": null, + "negationRationale": null, + "priority": null, + "qdmCategory": "encounter", + "qdmStatus": "performed", + "qdmTitle": "Encounter, Performed", + "qdmVersion": "5.5", + "relevantPeriod": null + }, + { + "_id": "6500d365e77bbf53b55d21e9", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.464.1003.113.12.1074", + "dataElementCodes": [ + + ], + "description": "Diagnosis: FrailtyDiagnosis", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21e9", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21ea", + "anatomicalLocationSite": null, + "authorDatetime": null, + "codeListId": "2.16.840.1.113883.3.526.3.1003", + "dataElementCodes": [ + + ], + "description": "Diagnosis: Proteinuria", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.110", + "id": "6500d365e77bbf53b55d21ea", + "prevalencePeriod": null, + "qdmCategory": "condition", + "qdmTitle": "Diagnosis", + "qdmVersion": "5.5", + "qrdaOid": "2.16.840.1.113883.10.20.24.3.135", + "severity": null + }, + { + "_id": "6500d365e77bbf53b55d21eb", + "birthDatetime": null, + "codeListId": "drc-c48426f721cede4d865df946157d5e2dc90bd32763ffcb982ca45b3bd97a29db", + "dataElementCodes": [ + + ], + "description": "Patient Characteristic Birthdate: Birth date", + "hqmfOid": "2.16.840.1.113883.10.20.28.4.54", + "id": "6500d365e77bbf53b55d21eb", + "qdmCategory": "patient_characteristic", + "qdmStatus": "birthdate", + "qdmTitle": "Patient Characteristic Birthdate", + "qdmVersion": "5.5" + } + ], + "title": "Diabetes: Medical Attention for Nephropathy", + "updated_at": "2023-09-12T21:08:53.110Z", + "value_set_ids": [ + "6500d363e77bbf53b55d215c", + "6500d363e77bbf53b55d215d", + "6500d363e77bbf53b55d215e", + "6500d365e77bbf53b55d215f", + "6500d365e77bbf53b55d2160", + "6500d365e77bbf53b55d2161", + "6500d365e77bbf53b55d2162", + "6500d365e77bbf53b55d2163", + "6500d365e77bbf53b55d2164", + "6500d365e77bbf53b55d2165", + "6500d365e77bbf53b55d2166", + "6500d365e77bbf53b55d2167", + "6500d365e77bbf53b55d2168", + "6500d365e77bbf53b55d2169", + "6500d365e77bbf53b55d216a", + "6500d365e77bbf53b55d216b", + "6500d365e77bbf53b55d216c", + "6500d365e77bbf53b55d216d", + "6500d365e77bbf53b55d216e", + "6500d365e77bbf53b55d216f", + "6500d365e77bbf53b55d2170", + "6500d365e77bbf53b55d2171", + "6500d365e77bbf53b55d2172", + "6500d365e77bbf53b55d2173", + "6500d365e77bbf53b55d2174", + "6500d365e77bbf53b55d2175", + "6500d365e77bbf53b55d2176", + "6500d365e77bbf53b55d2177", + "6500d365e77bbf53b55d2178", + "6500d365e77bbf53b55d2179", + "6500d365e77bbf53b55d217a", + "6500d365e77bbf53b55d217b", + "6500d365e77bbf53b55d217c", + "6500d365e77bbf53b55d217d", + "6500d365e77bbf53b55d217e", + "6500d365e77bbf53b55d217f", + "6500d365e77bbf53b55d2180", + "6500d365e77bbf53b55d2181", + "6500d365e77bbf53b55d2182", + "6500d365e77bbf53b55d2183", + "6500d365e77bbf53b55d2184", + "6500d365e77bbf53b55d2185", + "6500d365e77bbf53b55d2186", + "6500d365e77bbf53b55d2187", + "6500d365e77bbf53b55d2188" + ] + }, + "code": "200", + "show_in_doc": 1, + "recorded": true + } + ], + "measures#finalize": [ + { + "verb": "POST", + "path": "/measures", + "versions": [ + + ], + "query": null, + "request_data": { + "t679": { + "hqmf_id": "40280382667FECC30167190FAE723AAE", + "titles": [ + "ps1", + "ps1strat1", + "ps1strat2", + "ps1strat3" + ] + } + }, + "response_data": "You are being redirected.", + "code": "302", + "show_in_doc": 1, + "recorded": true } ], "measures#index": [ @@ -354,7 +33778,7 @@ ], "query": "", "request_data": null, - "response_data": null, + "response_data": "

api_v1/measures

\n\n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n
HQMF SET IDCMS IDTitle
7B2A9277-43DA-4D99-9BEE-6AC271A07747CMS134v6Diabetes: Medical Attention for NephropathyJSONCalculated Results
\n\n
", "code": "200", "show_in_doc": 1, "recorded": true @@ -431,7 +33855,14 @@ "1" ], "query": null, - "request_data": "Content-Type: multipart/form-data; boundary=APIPIE_RECORDER_EXAMPLE_BOUNDARY\n\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_query_type\"\nContent-Length: 7\n\nprofile\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_query_profile\"\nContent-Length: 11\n\nLatest eCQM\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_query_measure_defined\"\nContent-Length: 4\n\ntrue\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_tgt\"\nContent-Length: 65\n\nTGT-229792-vaQWUba1FcYreJsEW3vZpLrae9U6vObfqnC6mcysoa7obbL5zg-cas\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_tgt_expires_at\"\nContent-Length: 10\n\n1589254986\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"measure_file\"; filename=\"IETCQL_v5_0_Artifacts.zip\"\nContent-Length: 36765\nContent-Type: application/zip\nContent-Transfer-Encoding: binary\n\n... contents of \"measure_file\" ...\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"calculation_type\"\nContent-Length: 7\n\nepisode\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY--", + "request_data": { + "vsac_query_type": "profile", + "vsac_query_profile": "Latest eCQM", + "vsac_query_measure_defined": "true", + "vsac_api_key": "vcrpass", + "measure_file": "", + "calculation_type": "episode" + }, "response_data": { "status": "error", "messages": "No measure found for this HQMF Set ID." @@ -447,12 +33878,25 @@ "1" ], "query": null, - "request_data": "Content-Type: multipart/form-data; boundary=APIPIE_RECORDER_EXAMPLE_BOUNDARY\n\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"calculation_type\"\nContent-Length: 7\n\nepisode\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"measure_file\"; filename=\"CMS903v0.zip\"\nContent-Length: 26016\nContent-Type: application/zip\nContent-Transfer-Encoding: binary\n\n... contents of \"measure_file\" ...\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"population_titles[]\"\n\nFoo\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"population_titles[]\"\n\nbar\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"population_titles[]\"\n\nbaz\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"population_titles[]\"\n\nbam\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_query_measure_defined\"\nContent-Length: 4\n\ntrue\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_query_profile\"\nContent-Length: 11\n\nLatest eCQM\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_query_type\"\nContent-Length: 7\n\nprofile\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_tgt\"\nContent-Length: 66\n\nTGT-1609324-E4NK175OUeS0ixzo4WAPxPaNzuHVMvaYuJkzBkLbLgVRfY2Sy1-cas\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY\nContent-Disposition: form-data; name=\"vsac_tgt_expires_at\"\nContent-Length: 10\n\n1589254987\n--APIPIE_RECORDER_EXAMPLE_BOUNDARY--", + "request_data": { + "vsac_query_type": "profile", + "vsac_query_profile": "Latest eCQM", + "vsac_query_measure_defined": "true", + "vsac_api_key": "vcrpass", + "measure_file": "", + "calculation_type": "episode", + "population_titles": [ + "Foo", + "bar", + "baz", + "bam" + ] + }, "response_data": { - "status": "success", - "url": "/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076" + "status": "error", + "messages": "The measure could not be loaded, Bonnie has encountered an error while trying to load the measure." }, - "code": "200", + "code": "500", "show_in_doc": 1, "recorded": true } @@ -10454,5 +43898,22 @@ "show_in_doc": 1, "recorded": true } + ], + "vsac_util#auth_valid": [ + { + "verb": "GET", + "path": "/vsac_util/auth_valid", + "versions": [ + + ], + "query": "", + "request_data": null, + "response_data": { + "valid": true + }, + "code": "200", + "show_in_doc": 1, + "recorded": true + } ] } \ No newline at end of file diff --git a/test/fixtures/vcr_cassettes/api_ccdelookback_vsac_response.yml b/test/fixtures/vcr_cassettes/api_ccdelookback_vsac_response.yml index 24b2dd852..b44d697c0 100644 --- a/test/fixtures/vcr_cassettes/api_ccdelookback_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/api_ccdelookback_vsac_response.yml @@ -3188,4 +3188,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:41 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 25 Jun 2019 22:14:54 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_incorrect_hqmf_vsac_response.yml b/test/fixtures/vcr_cassettes/api_incorrect_hqmf_vsac_response.yml index 8c7fed8e0..b080f1e91 100644 --- a/test/fixtures/vcr_cassettes/api_incorrect_hqmf_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/api_incorrect_hqmf_vsac_response.yml @@ -99,4 +99,69 @@ http_interactions: AM"}' http_version: recorded_at: Tue, 16 Jul 2019 11:59:42 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_invalid_release_vsac_response.yml b/test/fixtures/vcr_cassettes/api_invalid_release_vsac_response.yml index 3813c7dd8..7d53ee4d5 100644 --- a/test/fixtures/vcr_cassettes/api_invalid_release_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/api_invalid_release_vsac_response.yml @@ -1110,4 +1110,69 @@ http_interactions: http_version: recorded_at: Tue, 25 Jun 2019 23:35:27 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 25 Jun 2019 22:14:54 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_missing_vs_vsac_response.yml b/test/fixtures/vcr_cassettes/api_missing_vs_vsac_response.yml index b312a4339..94fe85bf1 100644 --- a/test/fixtures/vcr_cassettes/api_missing_vs_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/api_missing_vs_vsac_response.yml @@ -99,4 +99,69 @@ http_interactions: AM"}' http_version: recorded_at: Tue, 16 Jul 2019 11:59:42 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 25 Jun 2019 22:14:54 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_release_ccdelookback_vsac_response.yml b/test/fixtures/vcr_cassettes/api_release_ccdelookback_vsac_response.yml index c1be086b6..5e6dc04d2 100644 --- a/test/fixtures/vcr_cassettes/api_release_ccdelookback_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/api_release_ccdelookback_vsac_response.yml @@ -15015,4 +15015,69 @@ http_interactions: \ \n\n" http_version: recorded_at: Tue, 16 Jul 2019 11:59:47 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_valid_vsac_response.yml b/test/fixtures/vcr_cassettes/api_valid_vsac_response.yml index d813929f2..b1fb75e4a 100644 --- a/test/fixtures/vcr_cassettes/api_valid_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/api_valid_vsac_response.yml @@ -935,6 +935,71 @@ http_interactions: http_version: recorded_at: Tue, 25 Jun 2019 22:14:54 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 25 Jun 2019 22:14:54 GMT - request: method: get uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113883.3.117.1.7.1.87&includeDraft=yes&profile=Latest%20eCQM&ticket=ST-6400509-v9SaJRJcOEXDglnGeiVQ-cas diff --git a/test/fixtures/vcr_cassettes/api_valid_vsac_response_def_titles.yml b/test/fixtures/vcr_cassettes/api_valid_vsac_response_def_titles.yml index d02d5c864..e69251225 100644 --- a/test/fixtures/vcr_cassettes/api_valid_vsac_response_def_titles.yml +++ b/test/fixtures/vcr_cassettes/api_valid_vsac_response_def_titles.yml @@ -3166,4 +3166,69 @@ http_interactions: http_version: recorded_at: Tue, 25 Jun 2019 23:06:14 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 25 Jun 2019 22:14:54 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_valid_vsac_response_initial.yml b/test/fixtures/vcr_cassettes/api_valid_vsac_response_initial.yml index dd499d587..9188e07f1 100644 --- a/test/fixtures/vcr_cassettes/api_valid_vsac_response_initial.yml +++ b/test/fixtures/vcr_cassettes/api_valid_vsac_response_initial.yml @@ -3166,4 +3166,69 @@ http_interactions: http_version: recorded_at: Tue, 25 Jun 2019 23:33:12 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_valid_vsac_response_non_exist_measure.yml b/test/fixtures/vcr_cassettes/api_valid_vsac_response_non_exist_measure.yml index 40e5d25c1..b235655ed 100644 --- a/test/fixtures/vcr_cassettes/api_valid_vsac_response_non_exist_measure.yml +++ b/test/fixtures/vcr_cassettes/api_valid_vsac_response_non_exist_measure.yml @@ -99,4 +99,69 @@ http_interactions: AM"}' http_version: recorded_at: Tue, 16 Jul 2019 11:59:48 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_valid_vsac_response_provided_titles.yml b/test/fixtures/vcr_cassettes/api_valid_vsac_response_provided_titles.yml index 64702eaa7..c83a88aed 100644 --- a/test/fixtures/vcr_cassettes/api_valid_vsac_response_provided_titles.yml +++ b/test/fixtures/vcr_cassettes/api_valid_vsac_response_provided_titles.yml @@ -3166,4 +3166,69 @@ http_interactions: http_version: recorded_at: Tue, 25 Jun 2019 23:14:40 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/api_valid_vsac_response_update.yml b/test/fixtures/vcr_cassettes/api_valid_vsac_response_update.yml index bea37cb54..a2d07ce0e 100644 --- a/test/fixtures/vcr_cassettes/api_valid_vsac_response_update.yml +++ b/test/fixtures/vcr_cassettes/api_valid_vsac_response_update.yml @@ -3166,4 +3166,69 @@ http_interactions: http_version: recorded_at: Tue, 25 Jun 2019 23:38:12 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/initial_response.yml b/test/fixtures/vcr_cassettes/initial_response.yml index 699f8f3cf..06a5e0707 100644 --- a/test/fixtures/vcr_cassettes/initial_response.yml +++ b/test/fixtures/vcr_cassettes/initial_response.yml @@ -3116,4 +3116,69 @@ http_interactions: http_version: recorded_at: Wed, 07 Aug 2019 15:54:09 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/invalid_vsac_response.yml b/test/fixtures/vcr_cassettes/invalid_vsac_response.yml index 26ddd1292..6591c6235 100644 --- a/test/fixtures/vcr_cassettes/invalid_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/invalid_vsac_response.yml @@ -1,52 +1,68 @@ --- http_interactions: -- request: - method: post - uri: https://vsac.nlm.nih.gov/vsac/ws/Ticket - body: - encoding: US-ASCII - string: username=invaliduser&password=invalidpassword - headers: - User-Agent: - - Typhoeus - https://github.com/typhoeus/typhoeus - Expect: - - '' - response: - status: - code: 401 - message: '' - headers: - X-Frame-Options: - - SAMEORIGIN - X-Content-Type-Options: - - nosniff - - nosniff - X-Xss-Protection: - - 1; mode=block - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Pragma: - - no-cache - Expires: - - '0' - Content-Type: - - text/plain;charset=utf-8 - Transfer-Encoding: - - chunked - Date: - - Tue, 16 Jul 2019 11:59:19 GMT - Set-Cookie: - - BIGipServervsacweb_p=!eRqM2NtZ2n18tE3NtNHn4GsLooFbU14UxvXhOnb5GWb4ylVopzXHM4r2xBCn3zJQUKSYkRsA1WagRrA=; - expires=Tue, 16-Jul-2019 13:59:19 GMT; path=/; Httponly; Secure - X-Vip-Info: - - 130.14.16.40:443 - X-Pool-Info: - - "/Common/vsacweb_p 10.1.5.114 8080" - Strict-Transport-Security: - - max-age=31536000; includeSubDomains; preload - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Tue, 16 Jul 2019 11:59:19 GMT + - request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 401 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/mat_5_4_valid_vsac_response.yml b/test/fixtures/vcr_cassettes/mat_5_4_valid_vsac_response.yml index ed5bf3224..c70027819 100644 --- a/test/fixtures/vcr_cassettes/mat_5_4_valid_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/mat_5_4_valid_vsac_response.yml @@ -4844,4 +4844,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:17 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/measure_destroy.yml b/test/fixtures/vcr_cassettes/measure_destroy.yml index f996934a6..56ee87f24 100644 --- a/test/fixtures/vcr_cassettes/measure_destroy.yml +++ b/test/fixtures/vcr_cassettes/measure_destroy.yml @@ -11782,4 +11782,69 @@ http_interactions: http_version: recorded_at: Wed, 07 Aug 2019 17:16:36 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/measure_loading_does_not_alter_expected_values.yml b/test/fixtures/vcr_cassettes/measure_loading_does_not_alter_expected_values.yml index f79044973..6583da511 100644 --- a/test/fixtures/vcr_cassettes/measure_loading_does_not_alter_expected_values.yml +++ b/test/fixtures/vcr_cassettes/measure_loading_does_not_alter_expected_values.yml @@ -3513,4 +3513,69 @@ http_interactions: http_version: recorded_at: Tue, 30 Jul 2019 13:46:23 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/measure_show.yml b/test/fixtures/vcr_cassettes/measure_show.yml index e265a89d7..f2f1e8472 100644 --- a/test/fixtures/vcr_cassettes/measure_show.yml +++ b/test/fixtures/vcr_cassettes/measure_show.yml @@ -4844,4 +4844,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:02 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/profile_draft_query.yml b/test/fixtures/vcr_cassettes/profile_draft_query.yml index 52bbd02cc..7be8ec7ba 100644 --- a/test/fixtures/vcr_cassettes/profile_draft_query.yml +++ b/test/fixtures/vcr_cassettes/profile_draft_query.yml @@ -3116,4 +3116,69 @@ http_interactions: http_version: recorded_at: Wed, 26 Jun 2019 00:00:17 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/profile_query.yml b/test/fixtures/vcr_cassettes/profile_query.yml index c3e47fc4e..2efeb8697 100644 --- a/test/fixtures/vcr_cassettes/profile_query.yml +++ b/test/fixtures/vcr_cassettes/profile_query.yml @@ -3116,4 +3116,69 @@ http_interactions: http_version: recorded_at: Wed, 26 Jun 2019 00:00:14 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/release_query.yml b/test/fixtures/vcr_cassettes/release_query.yml index bce98e6ba..5310b6c97 100644 --- a/test/fixtures/vcr_cassettes/release_query.yml +++ b/test/fixtures/vcr_cassettes/release_query.yml @@ -21139,4 +21139,69 @@ http_interactions: \ \n\n" http_version: recorded_at: Wed, 26 Jun 2019 00:00:20 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/unsupported_QDM_data_element.yml b/test/fixtures/vcr_cassettes/unsupported_QDM_data_element.yml index 058b60cfb..20a4f4bbc 100644 --- a/test/fixtures/vcr_cassettes/unsupported_QDM_data_element.yml +++ b/test/fixtures/vcr_cassettes/unsupported_QDM_data_element.yml @@ -2346,4 +2346,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:25 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/update_response.yml b/test/fixtures/vcr_cassettes/update_response.yml index 99ee5fccc..7aabed41b 100644 --- a/test/fixtures/vcr_cassettes/update_response.yml +++ b/test/fixtures/vcr_cassettes/update_response.yml @@ -3067,4 +3067,69 @@ http_interactions: http_version: recorded_at: Wed, 07 Aug 2019 15:54:27 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/upload_measure_virus_200_infected_false.yml b/test/fixtures/vcr_cassettes/upload_measure_virus_200_infected_false.yml index efe37879f..922477e6f 100644 --- a/test/fixtures/vcr_cassettes/upload_measure_virus_200_infected_false.yml +++ b/test/fixtures/vcr_cassettes/upload_measure_virus_200_infected_false.yml @@ -1817,4 +1817,69 @@ http_interactions: recorded_at: Mon, 22 Mar 2021 15:38:23 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 6.0.0 diff --git a/test/fixtures/vcr_cassettes/valid_vsac_response.yml b/test/fixtures/vcr_cassettes/valid_vsac_response.yml index 3448c67dc..f2feb9b61 100644 --- a/test/fixtures/vcr_cassettes/valid_vsac_response.yml +++ b/test/fixtures/vcr_cassettes/valid_vsac_response.yml @@ -1762,4 +1762,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:08 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/valid_vsac_response_Test169.yml b/test/fixtures/vcr_cassettes/valid_vsac_response_Test169.yml index 41283f97c..77840f120 100644 --- a/test/fixtures/vcr_cassettes/valid_vsac_response_Test169.yml +++ b/test/fixtures/vcr_cassettes/valid_vsac_response_Test169.yml @@ -2181,4 +2181,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:06 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/valid_vsac_response_composite.yml b/test/fixtures/vcr_cassettes/valid_vsac_response_composite.yml index a370bdbd3..22af76374 100644 --- a/test/fixtures/vcr_cassettes/valid_vsac_response_composite.yml +++ b/test/fixtures/vcr_cassettes/valid_vsac_response_composite.yml @@ -7061,4 +7061,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 12:00:33 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 25 Jun 2019 22:14:54 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/valid_vsac_response_hqmf_set_id_mismatch.yml b/test/fixtures/vcr_cassettes/valid_vsac_response_hqmf_set_id_mismatch.yml index 7a63c83fc..d1fbe0937 100644 --- a/test/fixtures/vcr_cassettes/valid_vsac_response_hqmf_set_id_mismatch.yml +++ b/test/fixtures/vcr_cassettes/valid_vsac_response_hqmf_set_id_mismatch.yml @@ -6183,4 +6183,69 @@ http_interactions: http_version: recorded_at: Wed, 07 Aug 2019 16:54:03 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/valid_vsac_response_reload_measure.yml b/test/fixtures/vcr_cassettes/valid_vsac_response_reload_measure.yml index f09db34e6..40f435300 100644 --- a/test/fixtures/vcr_cassettes/valid_vsac_response_reload_measure.yml +++ b/test/fixtures/vcr_cassettes/valid_vsac_response_reload_measure.yml @@ -3475,4 +3475,69 @@ http_interactions: http_version: recorded_at: Wed, 31 Jul 2019 17:39:21 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/vsac_500_response.yml b/test/fixtures/vcr_cassettes/vsac_500_response.yml index d79b03472..a0f00543e 100644 --- a/test/fixtures/vcr_cassettes/vsac_500_response.yml +++ b/test/fixtures/vcr_cassettes/vsac_500_response.yml @@ -1105,4 +1105,69 @@ http_interactions: http_version: recorded_at: Tue, 16 Jul 2019 11:59:22 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/fixtures/vcr_cassettes/vsac_not_found.yml b/test/fixtures/vcr_cassettes/vsac_not_found.yml index 9b8d89413..3b2552444 100644 --- a/test/fixtures/vcr_cassettes/vsac_not_found.yml +++ b/test/fixtures/vcr_cassettes/vsac_not_found.yml @@ -1049,4 +1049,69 @@ http_interactions: http_version: recorded_at: Wed, 26 Jun 2019 01:21:58 GMT +- request: + method: get + uri: https://vsac.nlm.nih.gov/vsac/svs/RetrieveMultipleValueSets?id=2.16.840.1.113762.1.4.1 + body: + encoding: US-ASCII + string: '' + headers: + User-Agent: + - Typhoeus - https://github.com/typhoeus/typhoeus + Expect: + - '' + response: + status: + code: 200 + message: '' + headers: + X-Frame-Options: + - SAMEORIGIN + X-Content-Type-Options: + - nosniff + - nosniff + X-Xss-Protection: + - 1; mode=block + Set-Cookie: + - BIGipServervsacweb_p=!SCfgAQec5rtpF53m9OGvBt4MxRMcjpPlF/OuKH6AP/UAcrxZqmT+h1oj21hM/AuyPQVjDWi/tpO9GEM=; + expires=Wed, 26-Jun-2019 00:14:54 GMT; path=/; Httponly; Secure + - JSESSIONID=0F17A9C8FEA88C36CB0D90F7B68A0BE0; Path=/vsac; HttpOnly;Secure + Cache-Control: + - no-cache, no-store, max-age=0, must-revalidate + Pragma: + - no-cache + Expires: + - '0' + Content-Type: + - text/xml;charset=utf-8 + Content-Length: + - '1356' + Date: + - Tue, 25 Jun 2019 22:14:53 GMT + X-Vip-Info: + - 130.14.16.40:443 + X-Pool-Info: + - "/Common/vsacweb_p 10.1.5.114 8080" + Strict-Transport-Security: + - max-age=31536000; includeSubDomains; preload + body: + encoding: UTF-8 + string: | + + + + + + + + Office of the National Coordinator for Health Information Technology + (Clinical Focus: Gender identity restricted to only Male and Female used in administrative situations requiring a restriction to these two categories.),(Data Element Scope: Gender),(Inclusion Criteria: Male and Female only.),(Exclusion Criteria: Any gender identity that is not male or female.) + Extensional + Dynamic + Active + 2019-06-25 + + + http_version: + recorded_at: Tue, 16 Jul 2019 11:59:42 GMT recorded_with: VCR 4.0.0 diff --git a/test/functional/api_v1/measures_controller_test.rb b/test/functional/api_v1/measures_controller_test.rb index 837b8ea5f..4f23763d8 100644 --- a/test/functional/api_v1/measures_controller_test.rb +++ b/test/functional/api_v1/measures_controller_test.rb @@ -86,7 +86,7 @@ class MeasuresControllerTest < ActionController::TestCase test 'should return bad_request when measure_file is not a file' do @request.env['CONTENT_TYPE'] = 'multipart/form-data' - post :create, params: {measure_file: 'not-a-file.gif', calculation_type: 'episode', vsac_tgt: 'foo', vsac_tgt_expires_at: @ticket_expires_at, vsac_query_type: 'profile'} + post :create, params: {measure_file: 'not-a-file.gif', calculation_type: 'episode', vsac_api_key: 'oof', vsac_query_type: 'profile'} assert_response :bad_request expected_response = { 'status' => 'error', 'messages' => "Invalid parameter 'measure_file': Must be a valid MAT Export." } assert_equal expected_response, JSON.parse(response.body) @@ -95,7 +95,7 @@ class MeasuresControllerTest < ActionController::TestCase test 'should return bad_request when measure_file is not a zip' do @request.env['CONTENT_TYPE'] = 'multipart/form-data' not_zip_file = fixture_file_upload(File.join('test','fixtures','measures','CMS160v6','cqm_measures','CMS160v6.json')) - post :create, params: {measure_file: not_zip_file, calculation_type: 'episode', vsac_tgt: 'foo', vsac_tgt_expires_at: @ticket_expires_at, vsac_query_type: 'profile'} + post :create, params: {measure_file: not_zip_file, calculation_type: 'episode', vsac_api_key: 'oof', vsac_query_type: 'profile'} assert_response :bad_request expected_response = { 'status' => 'error', 'messages' => "Invalid parameter 'measure_file': Must be a valid MAT Export." } assert_equal expected_response, JSON.parse(response.body) @@ -104,7 +104,7 @@ class MeasuresControllerTest < ActionController::TestCase test 'should return bad_request when the measure zip is not a MAT Export' do measure_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports','special_measures','not_mat_export.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' - post :create, params: {measure_file: measure_file, calculation_type: 'episode', vsac_tgt: 'foo', vsac_tgt_expires_at: @ticket_expires_at, vsac_query_type: 'profile'} + post :create, params: {measure_file: measure_file, calculation_type: 'episode', vsac_api_key: 'oof', vsac_query_type: 'profile'} assert_response :bad_request expected_response = { 'status' => 'error', 'messages' => "Invalid parameter 'measure_file': Must be a valid MAT Export." } assert_equal expected_response, JSON.parse(response.body) @@ -113,7 +113,7 @@ class MeasuresControllerTest < ActionController::TestCase test 'should return bad_request when calculation_type is invalid' do measure_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports','CMS52_v5_4_Artifacts.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' - post :create, params: {measure_file: measure_file, calculation_type: 'addition', vsac_tgt: 'foo', vsac_tgt_expires_at: @ticket_expires_at, vsac_query_type: 'profile'} + post :create, params: {measure_file: measure_file, calculation_type: 'addition', vsac_api_key: 'oof', vsac_query_type: 'profile'} assert_response :bad_request expected_response = { 'status' => 'error', 'messages' => "Invalid parameter 'calculation_type': Must be one of: episode, patient." } assert_equal expected_response, JSON.parse(response.body) @@ -136,10 +136,7 @@ class MeasuresControllerTest < ActionController::TestCase assert_nil measure VCR.use_cassette('api_valid_vsac_response', @vcr_options) do - # get ticket_granting_ticket - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'patient'} + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'patient'} assert_response :success expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) @@ -159,14 +156,14 @@ class MeasuresControllerTest < ActionController::TestCase @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_valid_vsac_response_dup_measure', @vcr_options) do # get ticket_granting_ticket - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'patient'} + + + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'patient'} assert_response :success expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'patient'} + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'patient'} assert_response :conflict expected_response = { 'status' => 'error', 'messages' => 'A measure with this HQMF Set ID already exists.', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) @@ -178,9 +175,9 @@ class MeasuresControllerTest < ActionController::TestCase @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_valid_vsac_response_def_titles', @vcr_options) do # get ticket_granting_ticket - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'patient'} + + + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'patient'} assert_response :ok expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) @@ -201,9 +198,9 @@ class MeasuresControllerTest < ActionController::TestCase @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_valid_vsac_response_provided_titles', @vcr_options) do # get ticket_granting_ticket - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode', population_titles: ['First Pop', 'First Strat', 'Second Strat', 'Third Strat']} + + + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'episode', population_titles: ['First Pop', 'First Strat', 'Second Strat', 'Third Strat']} assert_response :ok expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) @@ -223,9 +220,9 @@ class MeasuresControllerTest < ActionController::TestCase @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_valid_vsac_response_initial', @vcr_options) do # get ticket_granting_ticket - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode', population_titles: ['First Pop', 'First Strat', 'Second Strat', 'Third Strat']} + + + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'episode', population_titles: ['First Pop', 'First Strat', 'Second Strat', 'Third Strat']} assert_response :ok expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) @@ -243,10 +240,7 @@ class MeasuresControllerTest < ActionController::TestCase # Update the same measure VCR.use_cassette('api_valid_vsac_response_update', @vcr_options) do - # get ticket_granting_ticket - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - put :update, params: {id: '4DC3E7AA-8777-4749-A1E4-37E942036076', vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file1, calculation_type: 'episode', population_titles: %w[Foo bar baz bam]} + put :update, params: {id: '4DC3E7AA-8777-4749-A1E4-37E942036076', vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file1, calculation_type: 'episode', population_titles: %w[Foo bar baz bam]} assert_response :ok expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076' } assert_equal expected_response, JSON.parse(response.body) @@ -264,23 +258,11 @@ class MeasuresControllerTest < ActionController::TestCase measure_file = fixture_file_upload(File.join('test','fixtures','cqm_measure_exports','CMS903v0.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_invalid_release_vsac_response', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'release', vsac_query_release: 'Fake 1234', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode'} - assert_response :bad_request - expected_response = {'status'=>'error', 'messages'=>'VSAC value set (2.16.840.1.113883.3.117.1.7.1.87) not found or is empty. Please verify that you are using the correct profile or release and have VSAC authoring permissions if you are requesting draft value sets.'} - assert_equal expected_response, JSON.parse(response.body) - end - end - test 'should error on upload due to invalid VSAC ticket' do - measure_file = fixture_file_upload(File.join('test','fixtures','cqm_measure_exports','CMS903v0.zip'),'application/zip') - @request.env['CONTENT_TYPE'] = 'multipart/form-data' - VCR.use_cassette('api_invalid_ticket_vsac_response', @vcr_options) do - ticket = 'foo' - post :create, params: {vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode'} + + post :create, params: {vsac_query_type: 'release', vsac_query_release: 'Fake 1234', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'episode'} assert_response :bad_request - expected_response = {'status'=>'error', 'messages'=>'VSAC session expired. Please try again.'} + expected_response = {'status'=>'error', 'messages'=>'VSAC value set (2.16.840.1.113883.3.117.1.7.1.87) not found or is empty. Please verify that you are using the correct profile or release and have VSAC authoring permissions if you are requesting draft value sets.'} assert_equal expected_response, JSON.parse(response.body) end end @@ -289,9 +271,9 @@ class MeasuresControllerTest < ActionController::TestCase measure_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports','IETCQL_v5_0_missing_vs_oid_Artifacts.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_missing_vs_vsac_response', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode'} + + + post :create, params: {vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'episode'} assert_response :bad_request expected_response = {'status'=>'error', 'messages'=>'Measure loading process encountered error: The HQMF file references the following valuesets not present in the CQL: ["2.16.840.1.113883.3.464.1003.106.12.1005"]'} assert_equal expected_response, JSON.parse(response.body) @@ -302,9 +284,9 @@ class MeasuresControllerTest < ActionController::TestCase measure_update_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports','IETCQL_v5_0_Artifacts.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_valid_vsac_response_non_exist_measure', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - put :update, params: {id: '762B1B52-40BF-4596-B34F-4963188E7FF7', vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_update_file, calculation_type: 'episode'} + + + put :update, params: {id: '762B1B52-40BF-4596-B34F-4963188E7FF7', vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_update_file, calculation_type: 'episode'} assert_response :not_found expected_response = { 'status' => 'error', 'messages' => 'No measure found for this HQMF Set ID.'} assert_equal expected_response, JSON.parse(response.body) @@ -317,16 +299,14 @@ class MeasuresControllerTest < ActionController::TestCase measure_file = fixture_file_upload(File.join('test','fixtures','cqm_measure_exports','CMS903v0.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_incorrect_hqmf_id_vsac_response', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {measure_file: measure_file, calculation_type: 'episode', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at} + post :create, params: {measure_file: measure_file, calculation_type: 'episode', vsac_api_key: ENV['VSAC_API_KEY']} assert_response :success expected_response = { 'status' => 'success', 'url' => '/api_v1/measures/4DC3E7AA-8777-4749-A1E4-37E942036076'} assert_equal expected_response, JSON.parse(response.body) measure_update_file = fixture_file_upload(File.join('test','fixtures','cqm_measure_exports','CMS903v0_mismatch_hqmf_set_id.zip'),'application/zip') - put :update, params: {id: '4DC3E7AA-8777-4749-A1E4-37E942036076', measure_file: measure_update_file, calculation_type: 'episode', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at} + put :update, params: {id: '4DC3E7AA-8777-4749-A1E4-37E942036076', measure_file: measure_update_file, calculation_type: 'episode', vsac_api_key: ENV['VSAC_API_KEY']} assert_response :not_found expected_response = { 'status' => 'error', 'messages' => 'The update file does not have a matching HQMF Set ID to the measure trying to update with. Please update the correct measure or upload the file as a new measure.'} assert_equal expected_response, JSON.parse(response.body) @@ -337,9 +317,7 @@ class MeasuresControllerTest < ActionController::TestCase measure_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports','IETCQL_v5_0_bad_hqmf_Artifacts.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_incorrect_hqmf_vsac_response', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {measure_file: measure_file, calculation_type: 'episode', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at} + post :create, params: {measure_file: measure_file, calculation_type: 'episode', vsac_api_key: ENV['VSAC_API_KEY']} assert_response :internal_server_error expected_response = {'status'=>'error', 'messages'=>'The measure could not be loaded, Bonnie has encountered an error while trying to load the measure.'} assert_equal expected_response, JSON.parse(response.body) @@ -350,9 +328,7 @@ class MeasuresControllerTest < ActionController::TestCase measure_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports', 'CCDELookback_v5_4_Artifacts.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_ccdelookback_vsac_response', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_measure_defined: 'false', vsac_query_include_draft: 'false', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode', calculate_sdes: 'true'} + post :create, params: {vsac_query_measure_defined: 'false', vsac_query_include_draft: 'false', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'episode', calculate_sdes: 'true'} assert_response :success measure = CQM::Measure.where({hqmf_set_id: 'FA75DE85-A934-45D7-A2F7-C700A756078B'}).first assert_equal true, measure.calculate_sdes @@ -363,9 +339,7 @@ class MeasuresControllerTest < ActionController::TestCase measure_file = fixture_file_upload(File.join('test','fixtures','cql_measure_exports', 'CCDELookback_v5_4_Artifacts.zip'),'application/zip') @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('api_release_ccdelookback_vsac_response', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] - post :create, params: {vsac_query_type: 'release', vsac_query_measure_defined: 'true', vsac_tgt: ticket, vsac_tgt_expires_at: @ticket_expires_at, measure_file: measure_file, calculation_type: 'episode', calculate_sdes: 'false'} + post :create, params: {vsac_query_type: 'release', vsac_query_measure_defined: 'true', vsac_api_key: ENV['VSAC_API_KEY'], measure_file: measure_file, calculation_type: 'episode', calculate_sdes: 'false'} assert_response :success measure = CQM::Measure.where({hqmf_set_id: 'FA75DE85-A934-45D7-A2F7-C700A756078B'}).first assert_equal false, measure.calculate_sdes @@ -388,8 +362,7 @@ class MeasuresControllerTest < ActionController::TestCase @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('valid_vsac_response_composite_api_initial', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] + post :create, params: { vsac_query_type: 'profile', vsac_query_profile: 'eCQM Update 2020-05-07', @@ -412,8 +385,7 @@ class MeasuresControllerTest < ActionController::TestCase @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('valid_vsac_response_composite_api_again', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] + post :update, params: { vsac_query_type: 'profile', id: '244B4F52-C9CA-45AA-8BDB-2F005DA05BFC', @@ -443,8 +415,7 @@ class << measure_file end @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('valid_vsac_response_bad_composite_api', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] + post :create, params: { vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', @@ -452,8 +423,7 @@ class << measure_file vsac_query_measure_defined: 'true', measure_file: measure_file, calculation_type: 'patient', - vsac_tgt: ticket, - vsac_tgt_expires_at: @ticket_expires_at + vsac_api_key: ENV['VSAC_API_KEY'] } end @@ -469,8 +439,7 @@ class << measure_file end @request.env['CONTENT_TYPE'] = 'multipart/form-data' VCR.use_cassette('valid_vsac_response_bad_composite_api', @vcr_options) do - api = Util::VSAC::VSACAPI.new(config: APP_CONFIG['vsac'], api_key: ENV['VSAC_API_KEY']) - ticket = api.ticket_granting_ticket[:ticket] + post :create, params: { vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', @@ -478,8 +447,7 @@ class << measure_file vsac_query_measure_defined: 'true', measure_file: measure_file, calculation_type: 'patient', - vsac_tgt: ticket, - vsac_tgt_expires_at: @ticket_expires_at + vsac_api_key: ENV['VSAC_API_KEY'] } end assert_response :bad_request diff --git a/test/functional/measures_controller_test.rb b/test/functional/measures_controller_test.rb index 6cd0c5d82..34160a156 100644 --- a/test/functional/measures_controller_test.rb +++ b/test/functional/measures_controller_test.rb @@ -457,7 +457,7 @@ class << measure_file end test 'measure destroy' do - VCR.use_cassette('measure_destroy', @vcr_options) do + VCR.use_cassette('measure_destroy', {match_requests_on: [:method, :uri_no_st], :allow_playback_repeats => true}) do measure_file1 = fixture_file_upload(File.join('test', 'fixtures', 'cqm_measure_exports', 'CMS903v0.zip'), 'application/zip') measure_file2 = fixture_file_upload(File.join('test', 'fixtures', 'cqm_measure_exports', 'CMS134v8.zip'), 'application/zip') @@ -501,7 +501,7 @@ class << measure_file attr_reader :tempfile end # give it a fake VSAC ticket to get through the check for one - session[:vsac_tgt] = { ticket: 'fake ticket', expires: DateTime.now + 60.minutes } + session[:vsac_api_key] = "somethingNeat" post :create, params: {measure_file: measure_file, measure_type: 'eh', calculation_type: 'episode'} assert_equal 'Error Uploading Measure', flash[:error][:title] assert_equal 'The uploaded zip file is not a valid Measure Authoring Tool (MAT) export of a CQL Based Measure.', flash[:error][:summary] @@ -515,7 +515,7 @@ class << measure_file attr_reader :tempfile end # give it a fake VSAC ticket to get through the check for one - session[:vsac_tgt] = { ticket: 'fake ticket', expires: DateTime.now + 60.minutes } + session[:vsac_api_key] = "somethingNeat" post :create, params: {measure_file: measure_file, measure_type: 'eh', calculation_type: 'episode', vsac_api_key: ENV['VSAC_API_KEY']} assert_equal 'Error Uploading Measure', flash[:error][:title] assert_equal 'The uploaded zip file is not a valid Measure Authoring Tool (MAT) export of a CQL Based Measure.', flash[:error][:summary] @@ -529,8 +529,8 @@ class << measure_file class << measure_file attr_reader :tempfile end - # give it a fake VSAC ticket to get through the check for one - session[:vsac_tgt] = { ticket: 'fake ticket', expires: DateTime.now + 60.minutes } + # give it a fake VSAC key to get through the check for one + session[:vsac_api_key] = "somethingNeat" post :create, params: {measure_file: measure_file, measure_type: 'eh', calculation_type: 'episode'} assert_response :redirect @@ -555,7 +555,7 @@ class << measure_file test 'upload measure already loaded' do measure = nil # Use the valid vsac response recording each time attempting to upload measure - VCR.use_cassette('valid_vsac_response_reload_measure', @vcr_options) do + VCR.use_cassette('valid_vsac_response_reload_measure', {match_requests_on: [:method, :uri_no_st], :allow_playback_repeats => true}) do sign_in @user measure_file = fixture_file_upload(File.join('test', 'fixtures', 'cql_measure_exports', 'core_measures', 'CMS158v6_bonnie-fixtures@mitre.org_2018-01-11.zip'), 'application/zip') class << measure_file @@ -635,7 +635,7 @@ class << measure_file test 'update with hqmf set id mismatch' do # Upload the initial file - VCR.use_cassette('valid_vsac_response_hqmf_set_id_mismatch', @vcr_options) do + VCR.use_cassette('valid_vsac_response_hqmf_set_id_mismatch', {match_requests_on: [:method, :uri_no_st], :allow_playback_repeats => true}) do measure_file = fixture_file_upload(File.join('test', 'fixtures', 'cqm_measure_exports', 'CMS903v0.zip'), 'application/zip') class << measure_file attr_reader :tempfile @@ -825,7 +825,7 @@ class << measure_file assert_equal false, measure.calculation_method == 'EPISODE_OF_CARE' - VCR.use_cassette('valid_vsac_response', @vcr_options) do + VCR.use_cassette('valid_vsac_response', {match_requests_on: [:method, :uri_no_st], :allow_playback_repeats => true}) do post :create, params: { vsac_query_type: 'profile', vsac_query_profile: 'Latest eCQM', diff --git a/test/functional/vsac_util_controller_test.rb b/test/functional/vsac_util_controller_test.rb index 542b63145..6bf299d58 100644 --- a/test/functional/vsac_util_controller_test.rb +++ b/test/functional/vsac_util_controller_test.rb @@ -53,38 +53,11 @@ class VsacUtilControllerTest < ActionController::TestCase end test "vsac auth valid" do - # The ticket field was taken from the vcr_cassettes/valid_vsac_response file - session[:vsac_tgt] = {ticket: "ST-67360-HgEfelIvwUQ3zz3X39fg-cas", expires: Time.now.utc + 27000} - get :auth_valid - - assert_response :ok - assert_equal true, JSON.parse(response.body)['valid'] - end - - test "vsac auth invalid" do - # Time is past expired - # The ticket field was taken from the vcr_cassettes/valid_vsac_response file - session[:vsac_tgt] = {ticket: "ST-67360-HgEfelIvwUQ3zz3X39fg-cas", expires: Time.now.utc - 27000} - get :auth_valid - - assert_response :ok - assert_equal false, JSON.parse(response.body)['valid'] - end - - test "force expire vsac session" do - # The ticket field was taken from the vcr_cassettes/valid_vsac_response file - session[:vsac_tgt] = {ticket: "ST-67360-HgEfelIvwUQ3zz3X39fg-cas", expires: Time.now.utc + 27000} - post :auth_expire - - assert_response :ok - assert_equal "{}", response.body - - assert_nil session[:vsac_tgt] - - # Assert that vsac_auth_valid returns that vsac session is invalid - get :auth_valid - - assert_response :ok - assert_equal false, JSON.parse(response.body)['valid'] + session[:vsac_api_key] = "somethingNeat" + VCR.use_cassette('api_valid_vsac_response') do + get :auth_valid + assert_response :ok + assert_equal true, JSON.parse(response.body)['valid'] + end end end