Home > database >  Query last month, the average utilization of such confinement and bed using SQL
Query last month, the average utilization of such confinement and bed using SQL

Time:10-25

By patients in hospital master record query the patient until the last day of the last month of hospitalization days, the sum (hospital discharge date - date)/hospitalization, but if to calculate the last day of last month, if discharge date is empty? How to assign? Another is bed utilization rate, there is a patient record, record the patient daily expenses, including beds, calculate the sum of the number of beds use every day/every day during the month, the number of beds that how to calculate?

CodePudding user response:

The sum (NVL (discharge date, trunc (sysdate, 'mm)))/hospital, hospital discharge date is empty will default to you the last day of the need to calculate the date range,

Bed utilization rate requires accurate to each day, using the number of beds/total number of beds, the two data need to look at your watch and what is the

CodePudding user response:

This is not a technical problem that the two problems need to be confirmed with business, the first business confirmed: if the discharge date represent patients are discharged is empty? Second confirm with business: patient record patient day beds does represent the number plus one day beds use?

CodePudding user response:

Bed utilization rate has been calculated, using records of all the beds in the last month fee schedule of fees, and then divided by the number of data * days last month

CodePudding user response:

I understand it, if the discharge date is empty, then according to the last day of last month,
On January 15, in addition, if the patient is in the hospital, on February 20, courtyard, then statistical way to hospitalization days in February is (February 20 - January 15) or (February 20 - February 1),

CodePudding user response:

The
reference 4 floor AHUA1001 reply:
I understand it, if the discharge date is empty, then according to the last day of the last month,
On January 15, in addition, if the patient is in the hospital, on February 20, courtyard, then statistical way to hospitalization days in February is (February 20 - January 15) or (February 20 - February 1),



Is 2.20 to 1.15, the patient is the absence of the hospital directly from the last day of February statistics

Now have a nested query, already can be found out, but I feel not too good
  • Related