# Hospital visit charges date(s) of service are incorrectly being applied

**URL:** <https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668>\
**Category:** Day-to-Day Users\
**Tags:** billing, infrastructure\
**Created:** [June 9, 2025, 6:16pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668 "2025-06-09T18:16:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [June 9, 2025, 6:16pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/1 "2025-06-09T18:16:53Z")

</div>

![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/a/b/ab7290b68bfe99e1a660b9cc01458620012f77ea.jpeg)

In the module that I am building to be able to enter hospital visits in to the system without having to go to each patient chart to open an encounter. I ran across an interesting fact in the program design. @stephenwaite , when the code gets the billing data from the billing table. It uses the encounter date for the date(s) of service, rather than the individual line items’ dates. When filling out the native fee sheet, there is not an associated date of service for each line item in the form even though the database supports this. The UI does not support the ability to enter different date for each line item of service as when being at a hospital on different days. The native fee sheet would require the user to input 6 encounters for each date of service at the hospital.  
I ran into this when creating our module. I checked the database, each line item has the corresponding date of service at the hospital but the HCFA (pictured above) has only the encounter form date on there which will be rejected if submitted. Now, the question is how are we going to cross this bridge together? I can simply change our code to match what we are needing and go on my way and manage that change forever. But I don’t like doing that if at all possible. @stephenwaite, what would be the best way to handle this?

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [June 9, 2025, 6:25pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/2 "2025-06-09T18:25:04Z")

</div>

Hi @juggernautsei, how does the database support different dates of service?

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [June 9, 2025, 7:48pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/3 "2025-06-09T19:48:24Z")

</div>

![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/5/e/5e47ab04d14571ad500b0d352e538413d6663651.png)

Hi @stephenwaite, marry this screenshot of the billing table data with the HCFA form above. You can see that each line item has a different date. But on the HCFA. There is one date which is not any of these dates. The goal is to submit as many dates of service on a single HCFA as allowed.

In the code, this is applied to every line of service.

```
$out .= "DTP" . // Date of Service. Page 435.
"*" . "472" .
"*" . "D8" .
"*" . $claim->serviceDate() .
"~\n";

 public function serviceDate()
 {
     return str_replace('-', '', substr($this->encounter['date'], 0, 10));
 }

```

The encounter date is applied and not the line item date. To make this compatible with sending in up to 6 different dates of service on a single HCFA, the date from the line item would need to be used and not the encounter date. The native fee sheet stores the encounter date in the line item date field. However, that does not have to be as I have shown in the database screenshot. The user wants to take advantage of being all to have as many dates of hospital visits they are allowed to on one HCFA / 837

There is a way to do this with backwards compatibility.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [June 9, 2025, 7:58pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/4 "2025-06-09T19:58:21Z")

</div>

Isn’t that date the date it was entered into the fee sheet?

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [June 9, 2025, 8:15pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/5 "2025-06-09T20:15:50Z")

</div>

![image](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/3X/e/7/e770f3adc05700d9a88c072dc4492c925b30dd1b.png)

Since the fee sheet does not actively allow a user to selected a date for that field. My assumption is that date is the day the line item was entered. However, in my quest, this would work fine because the date will be utilized by my module to complete its function the fee sheet can continue to enter what date it enters in this field since functionally it has no use I can find in the billing process.

---

<div class="post-metadata">

**Author:** ![stephenwaite](https://community.open-emr.org/user_avatar/community.open-emr.org/stephenwaite/32/15754_2.png) [@stephenwaite](https://community.open-emr.org/u/stephenwaite)\
**Post date:** [June 9, 2025, 8:18pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/6 "2025-06-09T20:18:13Z")

</div>

It’s better to add a service date field to the table because that date is used for historical purposes for tracking the lifecycle of the claim.

---

<div class="post-metadata">

**Author:** ![juggernautsei](https://community.open-emr.org/user_avatar/community.open-emr.org/juggernautsei/32/10764_2.png) [@juggernautsei](https://community.open-emr.org/u/juggernautsei)\
**Post date:** [June 9, 2025, 11:03pm UTC](https://community.open-emr.org/t/hospital-visit-charges-date-s-of-service-are-incorrectly-being-applied/25668/7 "2025-06-09T23:03:27Z")

</div>

Ok, I will add a column to the table. Thanks for the info.
