In this case new facts are added to the OBSERVATION_FACT table regardless of whether or not the fact's encounter exists. This involves overwriting any matching fields. i.e. if the incoming fact matches a particular stored fact and its update date is greater than the update of the matching fact, then the new fact will overwrite the old fact.
Example:
<observation update_date="2008-05-04T18:13:51.498-04:00" sourcesystem_cd="PFT">
<event_id source="HIVE">100</event_id>
<patient_id source="HIVE">100</patient_id>
<concept_cd>FC30.00620</concept_cd>
<nval_num>10.9</nval_num>
</observation>
<observation update_date="2008-05-04T18:13:51.498-04:00" sourcesystem_cd="PFT">
<event_id source="HIVE">100</event_id>
<patient_id source="HIVE">100</patient_id>
<concept_cd>FC30.00621</concept_cd>
<nval_num>20.2</nval_num>
</observation>
<observation update_date="2008-10-04T18:13:51.498-04:00" sourcesystem_cd="PFT">
<event_id source="HIVE">100</event_id>
<patient_id source="HIVE">100</patient_id>
<concept_cd>FC30.00622</concept_cd>
<nval_num>76.0</nval_num>
</observation>
The rows in the OBSERVATION_FACT table before the update:
ENCOUNTER_NUM |
PATIENT_NUM |
CONCEPT_CD |
NVAL_NUM |
UPDATE_DATE |
100 |
100 |
FC30.00620 |
10.9 |
2008-05-04 18:13:51 |
100 |
100 |
FC30.00621 |
20.2 |
2008-05-04 18:13:51 |
100 |
100 |
FC30.00622 |
6.0 |
2008-05-04 18:13:51 |
The rows in the OBSERVATION_FACT table after the update:
ENCOUNTER_NUM |
PATIENT_NUM |
CONCEPT_CD |
NVAL_NUM |
UPDATE_DATE |
100 |
100 |
FC30.00620 |
100.9 |
2008-05-04 18:13:51 |
100 |
100 |
FC30.00621 |
6.0 |
2008-05-04 18:13:51 |
100 |
100 |
FC30.00622 |
76.0 |
2008-10-08 18:13:51 |
Assumption: the record(s) in the update file (new record) has the same primary key as a record(s) in the associated table (existing record).
Primary Key includes:
Description |
Column Name |
XML tag |
Encounter number |
ENCOUNTER_NUM |
<event_id> |
Patient number |
PATIENT_NUM |
<patient_id> |
Concept code |
CONCEPT_CD |
<concept_cd> |
Start date |
START_DATE |
<start_date> |
Modifier code |
MODIFIER_CD |
<modifier_cd> |
Observer code |
PROVIDER_ID |
<observer_cd> |
Append Flag = True
The following conditions will result in the new record replacing the existing record:
new record update date |
equal to (=) |
|
update date on the existing record |
|
new record update date |
greater than (>) |
|
update date on the existing record |
|
new record update date |
is not null |
AND |
update date on the existing record |
null |
new record update date |
null |
AND |
update date on the existing record |
null |
The following conditions will result in ignoring the new record and not updating the existing record:
new record update date |
less than (<) |
|
update date on the existing record |
|
new record update date |
null |
AND |
update date on the existing record |
is not null |