Missing Date of Information: Difference between revisions

From IMSMA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
If Date of Information is missing it has to be set depending on type of item. If the Data Entry Form that misses Date of Information is an Activity or Education then you might be able to use End date.
{{TOC right}}
==Missing Date of Information ==__NOEDITSECTION__
[[Image:Missing date info.png|1000px|center]]
<div align="center">
'' How it should NOT look like''
</div>
If ''Date of Information'' is missing it has to be set. If the DEF that misses ''Date of Information'' is an Activity or Education then you might be able to use ''End date''.
<pre>
<pre>
SELECT
SELECT
fieldreport.fieldreport_localid,
fieldreport.fieldreport_localid AS `Form ID`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
Line 8: Line 14:
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`
fieldreport.verifiedby AS `Approved by`,
imsmaenum.enumvalue AS `WB status`
FROM
FROM
fieldreport
fieldreport
INNER JOIN imsmaenum ON fieldreport.workbenchstatusenum_guid = imsmaenum.imsmaenum_guid
WHERE
WHERE
fieldreport.dateofreport IS NULL
fieldreport.dateofreport IS NULL  
ORDER BY
ORDER BY
fieldreport.fieldreport_localid ASC
imsmaenum.enumvalue DESC, `Form ID` ASC
</pre>
</pre>
'''Hazard'''


With this result set you can show the country which Hazards are affected and figure out a solution
If you have any output here you need to take action. The queries below help you to identify for which item(s) the rows in the table ''fieldreport'' need to be updated.
 
=== Hazard===__NOEDITSECTION__
[[Image:Missing date info2.png|1000px|center]]
<div align="center">
'' Example of result - it is '''important''' to decide where you may find a date to use that is in chronological order. ''
</div>
With this result set you can show the country which Hazards are affected and figure out a solution.
<pre>
<pre>
SELECT
SELECT
fieldreport.fieldreport_localid,
fieldreport.fieldreport_localid AS `Form ID`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
Line 28: Line 42:
fieldreport.dataenterer AS `Data enterer`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
fieldreport.verifiedby AS `Approved by`,
hazardinfoversion.hazard_localid
imsmaenum.enumvalue AS `WB status`,
hazardinfoversion.dataentrydate AS InfoVerDate
FROM
FROM
fieldreport
fieldreport
Inner Join hazardinfoversion ON fieldreport.fieldreport_guid = hazardinfoversion.fieldreport_guid
INNER JOIN hazardinfoversion ON fieldreport.fieldreport_guid = hazardinfoversion.fieldreport_guid
INNER JOIN imsmaenum ON fieldreport.workbenchstatusenum_guid = imsmaenum.imsmaenum_guid
WHERE
WHERE
fieldreport.dateofreport IS NULL  AND
fieldreport.dateofreport IS NULL  AND
hazardinfoversion.link_only =  '0'
hazardinfoversion.link_only =  '0'
ORDER BY
ORDER BY
fieldreport.fieldreport_localid ASC
InfoVerDate ASC,
`Form ID` ASC
</pre>
</pre>
'''Hazard reduction'''


=== Hazard reduction===__NOEDITSECTION__
With this result set you can show the country which Hazard Reductions are affected and figure out a solution e.g. use End date if NOT NULL
With this result set you can show the country which Hazard Reductions are affected and figure out a solution e.g. use End date if NOT NULL
<pre>
<pre>
Line 63: Line 80:
</pre>
</pre>


=== Accident===__NOEDITSECTION__
<pre>
</pre>
=== Victim===__NOEDITSECTION__
<pre>
</pre>
=== MRE===__NOEDITSECTION__
<pre>
</pre>
=== QM===__NOEDITSECTION__
<pre>
</pre>
=== Location===__NOEDITSECTION__
<pre>
</pre>
==Future date==__NOEDITSECTION__
Date of Information in the '''future'''. Use one day after the backup was taken in the WHERE.
Date of Information in the '''future'''. Use one day after the backup was taken in the WHERE.
<pre>
<pre>

Revision as of 16:15, 10 November 2016

Missing Date of Information

How it should NOT look like

If Date of Information is missing it has to be set. If the DEF that misses Date of Information is an Activity or Education then you might be able to use End date.

SELECT
fieldreport.fieldreport_localid AS `Form ID`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
imsmaenum.enumvalue AS `WB status`
FROM
fieldreport
INNER JOIN imsmaenum ON fieldreport.workbenchstatusenum_guid = imsmaenum.imsmaenum_guid
WHERE
fieldreport.dateofreport IS NULL 
ORDER BY
imsmaenum.enumvalue DESC, `Form ID` ASC

If you have any output here you need to take action. The queries below help you to identify for which item(s) the rows in the table fieldreport need to be updated.

Hazard

Example of result - it is important to decide where you may find a date to use that is in chronological order.

With this result set you can show the country which Hazards are affected and figure out a solution.

SELECT
fieldreport.fieldreport_localid AS `Form ID`,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
imsmaenum.enumvalue AS `WB status`,
hazardinfoversion.dataentrydate AS InfoVerDate
FROM
fieldreport
INNER JOIN hazardinfoversion ON fieldreport.fieldreport_guid = hazardinfoversion.fieldreport_guid
INNER JOIN imsmaenum ON fieldreport.workbenchstatusenum_guid = imsmaenum.imsmaenum_guid
WHERE
fieldreport.dateofreport IS NULL  AND
hazardinfoversion.link_only =  '0'
ORDER BY
InfoVerDate ASC,
`Form ID` ASC

Hazard reduction

With this result set you can show the country which Hazard Reductions are affected and figure out a solution e.g. use End date if NOT NULL

SELECT
fieldreport.fieldreport_localid,
fieldreport.dateofreport AS `Date of Information`,
fieldreport.reportreceiveddate AS `Data Entry Date`,
fieldreport.reportcompleteddate AS `Submitted Date`,
fieldreport.reportverifieddate AS `Approved Date`,
fieldreport.dataenterer AS `Data enterer`,
fieldreport.verifiedby AS `Approved by`,
hazreducinfoversion.startdate,
hazreducinfoversion.enddate,
hazreducinfoversion.hazreduc_localid
FROM
fieldreport
Inner Join hazreducinfoversion ON fieldreport.fieldreport_guid = hazreducinfoversion.fieldreport_guid
WHERE
fieldreport.dateofreport IS NULL  AND
hazreducinfoversion.link_only =  '0'
ORDER BY
fieldreport.fieldreport_localid ASC

Accident


Victim


MRE


QM


Location


Future date

Date of Information in the future. Use one day after the backup was taken in the WHERE.

SELECT
fieldreport.fieldreport_localid,
fieldreport.dateofreport
FROM
fieldreport
WHERE
fieldreport.dateofreport >  '2015-04-07'
Order by 2

{{#switch:|subgroup|child=|none=|#default=

}}{{#if:|}}{{#if:Upgrade Process|<td style="text-align:left;border-left-width:2px;border-left-style:solid;|{{#if:|}}}}{{#if:|{{#if:IMSMA Hub{{#switch:{{#if:|{{{border}}}|child}}|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:{{#if:|{{{border}}}|child}}|child||{{#ifeq:{{#if:|{{{border}}}|child}}|subgroup||{{#switch:missing date of information

|doc
|sandbox
|testcases =
|#default = {{#switch:
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}|}}{{#if:|{{{group2}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list2}}}

}}{{#if:|{{#if:IMSMA Hub{{#switch:{{#if:|{{{border}}}|child}}|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:{{#if:|{{{border}}}|child}}|child||{{#ifeq:{{#if:|{{{border}}}|child}}|subgroup||{{#switch:missing date of information

|doc
|sandbox
|testcases =
|#default = {{#switch:
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}|}}{{#if:|{{{group3}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list3}}}

}}{{#if:|{{#if:|{{{group4}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list4}}}

}}{{#if:|{{#if:|{{{group5}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list5}}}

}}{{#if:|{{#if:|{{{group6}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list6}}}

}}{{#if:|{{#if:|{{{group7}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list7}}}

}}{{#if:|{{#if:|{{{group8}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list8}}}

}}{{#if:|{{#if:|{{{group9}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list9}}}

}}{{#if:|{{#if:|{{{group10}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list10}}}

}}{{#if:|{{#if:|{{{group11}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list11}}}

}}{{#if:|{{#if:|{{{group12}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list12}}}

}}{{#if:|{{#if:|{{{group13}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list13}}}

}}{{#if:|{{#if:|{{{group14}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list14}}}

}}{{#if:|{{#if:|{{{group15}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list15}}}

}}{{#if:|{{#if:|{{{group16}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list16}}}

}}{{#if:|{{#if:|{{{group17}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list17}}}

}}{{#if:|{{#if:|{{{group18}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list18}}}

}}{{#if:|{{#if:|{{{group19}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list19}}}

}}{{#if:|{{#if:|{{{group20}}}<td style="text-align:left;border-left-width:2px;border-left-style:solid;|

{{{list20}}}

}}{{#if:|{{#if:IMSMA Hub{{#switch:{{#if:|{{{border}}}|child}}|subgroup|child=|none=|#default=

}}{{#ifeq:|Template|{{#ifeq:{{#if:|{{{border}}}|child}}|child||{{#ifeq:{{#if:|{{{border}}}|child}}|subgroup||{{#switch:missing date of information

|doc
|sandbox
|testcases =
|#default = {{#switch:
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}|}}

{{{below}}}

}}{{#switch:|subgroup|child=

|none=|#default=}}{{#ifeq:|Template|{{#ifeq:|child||{{#ifeq:|subgroup||{{#switch:missing date of information
|doc
|sandbox
|testcases =
|#default = {{#switch:hlist
 |plainlist
 |hlist
 |hlist hnum
 |hlist vcard
 |vcard hlist = 
 |#default = 
 }}
}}

}}}}}}