Table of Contents | ||
---|---|---|
|
...
a. get config by type and category (of composition) from [prm
].composition
а.1 in case there is no record in PRM.configurations with requested combination of type and category return 422 - (“Category {{Composition.category}} is not allowed for type {{Composition.type}}”)
b. get setting and compare config.condition data to composition data to find the desired setting (in case when some values isn’t exist - skip validation)
c. compare data from config.check with data from composition
...
Check (28) the difference between sign date and event.period.start -must be in range of min days and max days (for all items in composition.event). Base on config - COMPOSITION_SIGN_TERM.
Logic: min > <=composition.date
-composition.event.period.start
<= max
or
min > <=composition.date
-composition.event.period.start
(in case when config has only one parameter)Return 422 ("Difference between start date and sign date must be from <min> to <max> days") in case of error
...
Check (7) possibility to create composition for PREperson - COMPOSITION_PREPERSON_ALLOW.
Return 422 ("Forbidden to create composition with such category for preperson") in case of error
Validate (10) person age between min and max values in config - COMPOSITION_PERSON_AGE.
Skip this validation in case the patient is preperson with an empty age parameter
Calculating logic of person age:
...
Check (2) that referenced encounter in
composition.encounter
has type based on config - COMPOSITION_ENCOUNTER_TYPE.Return 422 ("Forbidden to create composition with selected encounter type") in case of error
Check (4) that referenced encounter in
composition.encounter
has status based on config - COMPOSITION_ENCOUNTER_STATUS.Return 422 ("Forbidden to create composition with selected encounter status") in case of error
Check (5) that difference with create encounter date and sign composition date must be in range of config - COMPOSITION_ENCOUNTER_SIGN_TERM:
min > <= composition.encounter.period.start - composition.date <= max
or
min > <= composition.encounter.period.start - composition.date (in case when config has only one parameter)Return 422 ("Difference between create encounter date and sign composition date must be in range of <min value> and <max value> days") in case of error
...
Check (33) that differenсe from sign date in previously created composition(parameter RelatedArtifact.type = '
replaces
') from parametercomposition.relates_to
and sign date of current composition between min and max. Base on config - COMPOSITION_CATEGORY_SIGN_DATE_REPLACE:
min > <=[old]composition.date (replaces)
-[new]composition.date
<= max
or
min > <=[old]composition.date (replaces)
-[new]composition.date
(in case when config has only one parameter)Return 422 ("Difference between sign date old and new composition must be from <min> to <max>") in case of error
...
When (39) composition type = “DRIVERS“ and
composition.event.code
= "DRIVERS_GROUP1_ADMIT" or "DRIVERS_GROUP2_ADMIT" -composition.event.period.start
andcomposition.event.period.end
is requiredReturn 422 ("Event period start and period end is required") in case of error
When (40) composition type = “DRIVERS“ and
composition.event.code
= "DRIVERS_GROUP1_DENY" or "DRIVERS_GROUP2_DENY" -composition.event.period.start
is required andcomposition.event.period.end
must be emptyReturn 422 ("Event period start is required and event period end must be empty") in case of error
When (40.1) composition type = “ADOPTION“ and composition.event.code = "ADOPTION_ADOPTER_INELIGIBLE" or "ADOPTION_ADOPTER_RELATIVE_INELIGIBLE" -
composition.event.period.start
is required andcomposition.event.period.end
must be emptyReturn 422 ("Event period start is required and event period end must be empty") in case of error
Check (38.1) all
event.code
must be unique. In case when composition has more than one eventReturn 422 ("Event codes must be unique") in case of error
Check (37.1) that
composition.event.code
corresponds to appropriate dictionary - COMPOSITION_EVENTSReturn 422 ('value is not allowed in enum") in case of error
...
When (25) composition type = “DRIVERS“ check that
event.period
(event.period.end
-event.period.start
) less than duration (depending on person age and compositionevent.code
). Base on config - COMPOSITION_EVENT_PERIOD_DURATION
Calculating logic:composition.event.period.end
-composition.event.period.start
<config.check
valueReturn 422 ("Composition event period duration must be less than <check.value> <check.units>") in case of error
Check (38) all
composition.event.code
in composition - it must corresponds to appropriate config and match with at least one combination of statuses - COMPOSITION_EVENT_CODE
examples:
if composition category = “DRIVERS_GROUP1“ check whatcomposition.event.code
must be:
"DRIVERS_GROUP1_ADMIT"
OR
"DRIVERS_GROUP1_DENY" and “DRIVERS_GROUP2_DENY“if composition category = “DRIVERS_GROUP2“ check that
composition.event.code
match with one of combination:
“DRIVERS_GROUP1_ADMIT“ and “DRIVERS_GROUP2_DENY“
OR
“DRIVERS_GROUP1_ADMIT“ and “DRIVERS_GROUP2_ADMIT“
OR
“DRIVERS_GROUP1_DENY“ and “DRIVERS_GROUP2_DENY“if composition category = “ADOPTERS“ check that
composition.event.code
match with one of combination:
”ELIGIBLE”
OR
”INELIGIBLE”Return 422 ("Invalid event code for current composition category") in case of error
Check (28.1) that
composition.event.period.start
<composition.event.period.end
Return 422 ("Period end of event must be later than event start period") in case of error
13. АuthorizeInform with
Validate value in the field $.authorize_withinform_with, string, optional.
Check that authentication method with type = 'THIRD_PERSON' is submitted in $.authorize_with for person (in composition.subject) that must be authorized by confidant person using following logic:persons age < no_self_registration_age global parameter;persons age between no_self_registration_age and person_full_legal_capacity_age global parameters and person does not have document with type from PERSON_LEGAL_CAPACITY_DOCUMENT_TYPES config parameter;persons age > person_full_legal_capacity_age global parameter and exists at least one active and approved confidant person relationship for person (using following process Check confidant person relationship with person_id = person_id from request - expected :ok, :approved response)in case of error - return 422 ('Authentication method with type THIRD_PERSON must be submitted for this person')
Check that $.
authorize_withinform_with is a valid uuidin case error - return 422 ('string does not match pattern') with uuid regexp
Check that authentication method exists in MPI database,
person_authentication_methods
table (with is_active = true), belongs to the same patient as set in the create composition request, is active (ended_at > now() or ended_at is null) and type != NAin case error - return 422 ('Authentication method doesn't exist, is inactive or does not belong to this person')
Get value of
THIRD_PERSON_CONFIDANT_PERSON_RELATIONSHIP_CHECK
config parameter, if it is set totrue
- for authentication method with type = ‘THIRD_PERSON’ check that person from value is an approved confidant for a patient from create composition request – exists active and approved confidant person relationship between person from request and person_id from authentication method value (using following logic: Check confidant person relationship withperson_id
= person_id from request andconfidant_person_id
= value from auth method - expected:ok, :approved
response)in case of error - return 422 ('
Authentication method doesn't exist, is inactive or does not belong to this person''Auth method is not active or confidant person relationship is invalid')
14. Title
Get count of records in ME.requisition_number where requisition_number is equal to Composition.title and entity is equal to “composition” and type is equal to Composition.type.coding[0].code and patient_id = patient_id from the request
if count = 0 Return 422 ("Composition title is invalid
or expired") in case of error
Check there is no Composition with the same title in the DB
in case of error return 422 “Composition with title <title> already exists“
...
Check (43) count of medical records in
composition.section.entry
<= then value from config - COMPOSITION_SECTION_ENTRY_LIMIT.Return 422 ("Limit of medical records for this composition type and category must be less or equal <RECORDS_LIMIT>") in case of error
Check (41) codes for all records from
composition.section.entry
whereresource.type
= "observation" on prohibited values for composition (all records not include prohibited codes), depends on event codes which included in config - COMPOSITION_SECTION_ENTRY_PROHIBITED_CODES whereconfig.resource_type
= "observation"Return 422 ("Prohibited observation code - <code> in section.entry for current composition") in case of error
Check (41.1) codes for all records from
composition.section.entry
whereresource.type
= "condition" on prohibited values for composition (all records not include prohibited codes), depends on event codes which included in config - COMPOSITION_SECTION_ENTRY_PROHIBITED_CODES whereconfig.resource_type
= "condition"Return 422 ("Prohibited condition code - <code> in section.entry for current composition") in case of error
Check (42) codes for all records from
composition.section.entry
whereresource.type
= "observation" on required values for composition (at least one record composition entry must contain) which depends onsection.code
wich included in config - COMPOSITION_SECTION_ENTRY_REQUIRED_CODES whereconfig.resource_type
= "observation"Return 422 ("Empty required codes in section.entry for current composition") in case of error
Check (42.1) codes for all records from
composition.section.entry
whereresource.type
= "condition" on required values for composition (at least one record composition entry must contain) which depends onsection.code
wich included in config - COMPOSITION_SECTION_ENTRY_REQUIRED_CODES whereconfig.resource_type
= "condition"Return 422 ("Empty required codes in section entry for current composition") in case of error
Check (44 + 45) existing in composition required and optional sections codes which depends on
section.code
- COMPOSITION_SECTION_CONFIG
Logic description:
Find allconfig.code
where parameterconfig.mandatory
= true and compare all codes tocomposition.section.[n].code
. In case when config has nested sections but parametermandatory
= false - don't compare codes to nested sections.
Logic description:in case when object from
config
orconfig.sections.[n]
havemandatory
= true butcomposition.section.code
orcomposition.section.section.[n].code
hasn’t same value inconfig.code
orconfig.sections.[n].code
- return errorin case when
composition.section.code
has code wich hasn’tconfig.code
- return errorReturn 422 ("Invalid section content. Mandatory section
{{code}}
is missed") in case of error with empty required fields
Check (45.1) section codes for nested sections hierarchy from config which depends on config - COMPOSITION_SECTION_CONFIG
Logic description:
Check that all values fromcomposition.section.code
equal toconfig.code
fromconfig.sections
on the same nested level whereconfig.sectionAllowed
= truein case when value from
composition.section.code
hasn’t same values with nestedconfig.code
(fromconfig.sections
) orcomposition.section.code
has codes wich doesn’t exist inconfig.code
(fromconfig.sections
) - return error Return 422 ("Invalid section hierarchy for nested section") in case of error with empty required fields
examples
success case:
Composition -composition.section.code
= MAIN, nested section -composition.section.section.code
= PEDIATRIST
Config -config.sectionAllowed
= true,config.code
= MAIN,config.section.code
= PEDIATRIST
error case 1:
Composition -composition.section.code
= MAIN, nested section -composition.section.section.code
= NURSING
Config -config.sectionAllowed
= true,config.code
= MAIN,config.section.code
= PEDIATRIST
error case 2:
Composition -composition.section.code
= MAIN, nested section -composition.section.section.code
= PEDIATRIST
Config -config.sectionAllowed
= true,config.code
= MAIN,config.section.code
= PEDIATRIST +config.section.code
= MAINCheck (45.2) section content for all sections which depends on section code - COMPOSITION_SECTION_CONFIG
Configuration parameters description:
if
sectionAllowed
= true current section can contain nested sectionsif
isEmpty
= true current section can contain emptyReason parameter instead ofentry
arrayif
containsResources
= true current section can containentry
andorderBy
parameters
Validate section content:
Check that current section contains just one of:
nested
section
parameteremptyReason
parameterentry
parameterin case of error an error return 422 ("Section {{section_code}} must contain one AND only one of: nested
section
,emptyReason
orentry
")
In case section contains
entry
parameter check thatcontainsResources
= truein case
containsResources
= false return 422 ("Section {{section_code}} can not containentry
")
In case section contains emptyReason check that
isEmpty
= truein case
isEmpty
= false return 422 ("Section {{section_code}} can not contain emptyReason")
In case section contains nested
section
check thatsectionAllowed
= truein case
sectionAllowed
= false return 422 ("Section {{section_code}} can not contain nestedsection
")
Check (46) nesting level of sections <= the allowed limit - COMPOSITION_SECTION_NESTING_LEVEL
Return 422 ("Prohibited nested level for composition section") in case of error
Check (47) count of section <= than value from - COMPOSITION_SECTION_COUNT_LIMIT
Return 422 ("Prohibited amount of composition section") in case of error
...
Check (48) composition.section.title
Check that composition.section.title is not empty.
Also check value from COMPOSITION_SECTION_TITLE_MANUAL_FILL config (depends on
composition.section.code
)if config.value = "true" (or section with same code doesn't exist) - don’t validate
composition.section.title
else if value = "false"
get display value from COMPOSITION_SECTION_CODES dictionary where key=
composition.section.code
check
composition.section.title
= display
Return 422 ("Invalid title for composition.section") in case of error
Check (48.1) that section code (
composition.section.code
) corresponds to appropriate dictionary - COMPOSITION_SECTION_CODESReturn 422 ("Section code value is not allowed in enum") in case of error
Check (48.2) that section order by parameter (
composition.section.orderby
) corresponds to appropriate dictionary - COMPOSITION_SECTION_ORDERBYReturn 422 ("Section order by value is not allowed in enum") in case of error
Check (48.3) that empty reason (
composition.section.emptyreason
) corresponds to appropriate config - COMPOSITION_SECTION_EMPTY_REASON. In case whencomposition.section.emptyreason
is not emptyReturn 422 ("Empty reason value is not allowed in enum") in case of error
Check (50) that person from all records in
composition.section.entry
the same ascomposition.subject
(or merged person inmpi.merged_person
)Return 422 ("Person from section.entry must be the same as composition.subject or composition.section.focus") in case of error
Check (54) that author position from
section.author
based on config - COMPOSITION_SECTION_AUTHOR_POSITION for selectedsection.code
Return 422 ("Section author position does not allow") in case of error
Check (55) that author speciality from
section.author
based on config - COMPOSITION_SECTION_AUTHOR_SPECIALITY for selectedsection.code
Return 422 ("Section author speciality does not allow to create such composition") in case of error
Check (55.1) that author main speciality (
employee.accreditation.speciality_officio
= true ) fromsection.author
based on based on config - COMPOSITION_SECTION_AUTHOR_MAIN_SPECIALITYReturn 422 ("Section author main speciality does not allow to create such composition") in case of error
Check (56) count of resources from
composition.section.entry
selectedsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_LIMITReturn 422 ("Max count of resources in
section.entry
- <count>") in case of error
Check (56.1) that the resource type of the resource in
composition.section.entry
is allowed by config COMPOSITION_SECTION_SECTION_ENTRY_RESOURCESfor thissection.code
andevent.code
Return 422 ("Resource type is not allowed in this section for this event code") in case of error
...
Check (57) that referenced episode (if entry has resource with this type) from
composition.section.entry
has type based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TYPEReturn 422 ("Invalid referenced episode type in section.entry") in case of error
Check (58) that referenced episode (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced episode status in section.entry") in case of error
Check (59) that different from sign composition date and referenced episode (if entry has resource with this type)
period.start
incomposition.section.entry
between min and max (depending on Composition type, category and section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_START:
min > <=composition.date
-episode.period.start
<= max
or
min > <=composition.date
-period.start
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced episode start date must be from <min> to <max>") in case of error
...
Check (60) that referenced diagnostic report (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced diagnostic report status in section.entry") in case of error
Check (61) that referenced diagnostic report (if entry has resource with this type) from
composition.section.entry
has code based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CODE where resource_type = "diagnostic report"Return 422 ("Invalid code in referenced diagnostic report at section.entry") in case of error
Check (62) that referenced diagnostic report (if entry has resource with this type) from
composition.section.entry
has category based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CATEGORYReturn 422 ("Invalid category in referenced diagnostic report at section.entry") in case of error
Check (63) that different from sign composition date and referenced diagnostic report (if entry has resource with this type)
effective_period.end
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_END:
min > <=composition.date
-diagnostic_report.effective_period.end
<= max
or
min > <=composition.date
-diagnostic_report.effective_period.end
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced diagnostic report end date must be from <min> to <max>") in case of error
Check (63.1) that different from sign composition date and referenced diagnostic report (if entry has resource with this type)
issued
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CREATED_AT:
min > <=composition.date
-diagnostic_report.issued
<= max
or
min > <=composition.date
-diagnostic_report.issued
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced diagnostic report issued date must be from <min> to <max>") in case of error
...
Check (64) that referenced encounter (if entry has resource with this type) from
composition.section.entry
has type based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TYPE whereresource_type
= "encounter"Return 422 ("Invalid referenced encounter type in section.entry") in case of error
Check (65) that referenced encounter (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced encounter status in section.entry") in case of error
Check (66) that referenced encounter (if entry has resource with this type) from
composition.section.entry
has class (class.coding.code and class.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_ENCOUNTER_CLASSReturn 422 ("Invalid referenced encounter class in section.entry") in case of error
Check (67) that different from sign composition date and referenced encounter (if entry has resource with this type)
period.end
ordate
(depending on which parameter is filled) incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_END:
min > <=composition.date
-encounter.period.end
orencounter.date
<= max
or
min > <=composition.date
-encounter.period.end
orencounter.date
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced encounter (in section.entry) end date must be from <min> to <max>") in case of error
...
Check (67.1) that referenced care plan (if entry has resource with this type) from
composition.section.entry
has category based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CATEGORYReturn 422 ("Invalid category in referenced care plan at section.entry") in case of error
Check (68) that referenced care plan (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced care plan status in section.entry") in case of error
Check (70) that different from sign composition date and referenced care plan (if entry has resource with this type)
period.start
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_START:
min > <=composition.date
-care_plan.period.start
<= max
or
min > <=composition.date
-care_plan.period.start
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced care plan start date must be from <min> to <max>") in case of error
...
Check (74) that referenced procedure (if entry has resource with this type) from
composition.section.entry
has code (code.identifier.type.coding.code and code.identifier.type.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TYPEReturn 422 ("Invalid referenced procedure type in section.entry") in case of error
Check (75) that referenced procedure (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced procedure status in section.entry") in case of error
Check (76) that different from sign composition date and referenced procedure (if entry has resource with this type) between min and max (depends on section code):
if procedure has filledperformed_period.end
incomposition.section.entry
calculate:
min > <=composition.date
-procedure.performed_period.end
<= max
or
min > <=composition.date
-procedure.performed_period.end
(in case when config has only one parameter)
Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_END whereresource_type
= "procedure"
if procedure has filledperformed_date_time
incomposition.section.entry
calculate:
min > <=composition.date
-procedure.performed_date_time
<= max
or
min > <=composition.date
-procedure.performed_date_time
(in case when config has only one parameter)
Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "procedure" andaction
= "performed"Return 422 ("Difference between sign composition date and referenced procedure date must be from <min> to <max>") in case of error
...
Check (77) that referenced condition (if entry has resource with this type) from
composition.section.entry
has code (at least one item in code.coding array (code.coding.code and code.coding.system)) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CODE whereresource_type
= "condition"Return 422 ("Invalid referenced condition code.coding in section.entry") in case of error
Check (78) that referenced condition (if entry has resource with this type) from
composition.section.entry
has clinical_status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced condition clinical_status in section.entry") in case of error
Check (79) that referenced condition (if entry has resource with this type) from
composition.section.entry
has verification_status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_CONDITION_VERIFICATION_STATUSReturn 422 ("Invalid referenced condition verification_status in section.entry") in case of error
Check (80) that different from sign composition date and referenced condition (if entry has resource with this type)
asserted_date
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "condition" andaction
= "asserted":
min > <=composition.date
-condition.asserted_date
<= max
or
min > <=composition.date
-condition.asserted_date
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced condition asserted date must be from <min> to <max>") in case of error
Check (81) that different from sign composition date and referenced condition (if entry has resource with this type)
onset_date
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "condition" andaction
= "onset":
min > <=composition.date
-condition.onset_date
<= max
or
min > <=composition.date
-condition.onset_date
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced condition onset date must be from <min> to <max>") in case of error
...
Check (82) that referenced observation (if entry has resource with this type) from
composition.section.entry
has code (code.coding.code and code.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CODE whereresource_type
= "observation"Return 422 ("Invalid code in referenced observation at section.entry") in case of error
Check (83) that referenced observation (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced observation status in section.entry") in case of error
Check (84) that referenced observation (if entry has resource with this type) from
composition.section.entry
has category based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CATEGORYReturn 422 ("Invalid category in referenced observation at section.entry") in case of error
Check (85) that different from sign composition date and referenced observation (if entry has resource with this type)
issued
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "observation" andaction
= "issued":
min > <=composition.date
-observation.issued
<= max
or
min > <=composition.date
-observation.issued
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced observation issued date must be from <min> to <max>") in case of error
Return 422 ("Invalid referenced observation date in section.entry") in case of error
Check (86) that different from sign composition date and referenced observation (if entry has resource with this type) between min and max (depends on section code):
if observation has filledeffective_period.end
incomposition.section.entry
calculate:
min > <=composition.date
-observation.effective_period.end
<= max
or
min > <=composition.date
-observation.effective_period.end
(in case when config has only one parameter)
Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_END whereresource_type
= "observation"
if observation has filledeffective_date_time
incomposition.section.entry
calculate:
min > <=composition.date
-observation.effective_date_time
<= max
or
min > <=composition.date
-observation.effective_date_time
(in case when config has only one parameter)
Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "observation" andaction
= "effective"Return 422 ("Difference between sign composition date and referenced observation date must be from <min> to <max>") in case of error
...
Check (90) that referenced immunization (if entry has resource with this type) from
composition.section.entry
has explanation.reason_not_given (explanattion.reason_not_given.coding.code and explanation.reason_not_given.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_IMMUNIZATION_EXPLANATION_REASON_NOT_GIVENReturn 422 ("Invalid referenced immunization explanation reason not given in section.entry") in case of error
Check (91) that referenced immunization (if entry has resource with this type) from
composition.section.entry
has explanation.reason (explanattion.reason.coding.code and explanation.reason.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_IMMUNIZATION_EXPLANATION_REASONReturn 422 ("Invalid referenced immunization explanation reason in section.entry") in case of error
Check (92) that referenced immunization (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced immunization status in section.entry") in case of error
Check (93) that referenced immunization (if entry has resource with this type) from
composition.section.entry
has vaccine_code (vaccine_code.coding.code and vaccine_code.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CODE whereresource_type
= "immunization"Return 422 ("Invalid vaccine code in referenced immunization at section.entry") in case of error
Check (94) that referenced immunization (if entry has resource with this type) from
composition.section.entry
has report_origin (report_origin.coding.code and report_origin.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_IMMUNIZATION_REPORT_ORIGINReturn 422 ("Invalid referenced immunization report origin in section.entry") in case of error
Check (95) that different from sign composition date and referenced immunization (if entry has resource with this type)
date
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "immunization" andaction
= "date":
min > <=composition.date
-immunization.date
<= max
or
min > <=composition.date
-immunization.date
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced immunization date must be from <min> to <max>") in case of error
...
Check (96) that referenced medication request (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced medication request status in section.entry") in case of error
Check (97) that different from sign composition date and referenced medication request (if entry has resource with this type)
created_at
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "medication request" andaction
= "created":
min > <=composition.date
-medication_request.created_at
<= max
or
min > <=composition.date
-medication_request.created_at
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced medication request created date must be from <min> to <max>") in case of error
Check (98) that different from sign composition date and referenced medication request (if entry has resource with this type)
started_at
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_START:
min > <=composition.date
-medication_request.started_at
<= max
or
min > <=composition.date
-medication_request.started_at
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and referenced medication request started at date must be from <min> to <max>") in case of error
...
Check (100) that referenced service request (if entry has resource with this type) from
composition.section.entry
has category (category.coding.code and category.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CATEGORYReturn 422 ("Invalid category in referenced service request at section.entry")
Check (101) that referenced service request (if entry has resource with this type) from
composition.section.entry
has code.identifier (code.identifier.type.coding.code and code.identifier.type.coding.system) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_CODE whereresource_type
= "service request"Return 422 ("Invalid code identifier in referenced service request at section.entry") in case of error
Check (102) that referenced service request (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_STATUSReturn 422 ("Invalid referenced service request status in section.entry") in case of error
Check (103) that different from sign composition date and referenced service request (if entry has resource with this type) between min and max (depends on section code):
if service request has filledoccurrence_period.start
incomposition.section.entry
calculate:
min > <=composition.date
-service_request.occurrence_period.start
<= max
or
min > <=composition.date
-service_request.occurrence_period.start
(in case when config has only one parameter)
Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_PERIOD_START whereresource_type
= "service request"
if service request has filledoccurrence_date_time
incomposition.section.entry
calculate:
min > <=composition.date
-service_request.occurrence_date_time
<= max
or
min > <=composition.date
-service_request.occurrence_date_time
(in case when config has only one parameter)
Base on config - COMPOSITION_SECTION_SECTION_ENTRY_RESOURCE_TERM whereresource_type
= "service request" andaction
= "occurrence"Return 422 ("Difference between sign composition date and referenced service request date must be from <min> to <max>") in case of error
...
Check (122) that referenced employee (if entry has resource with this type) from
composition.section.entry
has status based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_EMPLOYEE_STATUSReturn 422 ("Invalid referenced employee status in section.entry") in case of error
Check (123) that referenced employee (if entry has resource with this type) from
composition.section.entry
has position based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_EMPLOYEE_POSITIONReturn 422 ("Invalid referenced employee position in section.entry") in case of error
Check (124) that referenced employee (if entry has resource with this type) from
composition.section.entry
has speciality based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_EMPLOYEE_SPECIALITYReturn 422 ("Invalid referenced employee speciality in section.entry") in case of error
Check (124.1) that referenced employee (if entry has resource with this type) from
composition.section.entry
has main speciality (employee.accreditation.speciality_officio
= true ) based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_EMPLOYEE_MAIN_SPECIALITYReturn 422 ("Invalid referenced employee main speciality in section.entry") in case of error
Check (125) that referenced employee (if entry has resource with this type) from
composition.section.entry
has type based on dictionary which depends onsection.code
- COMPOSITION_SECTION_SECTION_ENTRY_EMPLOYEE_TYPEReturn 422 ("Invalid referenced employee type in section.entry") in case of error
Check (126) that different from sign composition date and referenced employee (if entry has resource with this type) start working date -
start_date
incomposition.section.entry
between min and max (depends on section code). Base on config - COMPOSITION_SECTION_SECTION_ENTRY_DEVICE_DISPENSE_WHEN_HANDED_OVER:
min > <=composition.date
-employee.start_date
<= max
or
min > <=composition.date
-employee.start_date
(in case when config has only one parameter)Return 422 ("Difference between sign composition date and employee start working date must be from <min> to <max>") in case of error
...