Skip to content

Commit

Permalink
feat: allow 1 char first names for insurance subscriber (openemr#7715)
Browse files Browse the repository at this point in the history
* feat: allow 1 char first names for insurance subscriber

* change Tests Validators to use empty fname

* update patient service test to use empty fname
  • Loading branch information
stephenwaite committed Sep 18, 2024
1 parent b759180 commit 704bfd0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Billing/X125010837P.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ public static function genX12837P(
$proccount = $claim->procCount();
$clm_total_charges = 0;
for ($prockey = 0; $prockey < $proccount; ++$prockey) {
$clm_total_charges += $claim->cptCharges($prockey);
$clm_total_charges += floatval($claim->cptCharges($prockey));
}
if (!$clm_total_charges) {
$log .= "*** This claim has no charges!\n";
Expand Down
2 changes: 1 addition & 1 deletion src/Validators/CoverageValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function (Validator $context) {
$context->optional('group_number')->lengthBetween(2, 255);
$context->required('subscriber_lname')->lengthBetween(2, 255);
$context->optional('subscriber_mname')->lengthBetween(1, 255);
$context->required('subscriber_fname')->lengthBetween(2, 255);
$context->required('subscriber_fname')->lengthBetween(1, 255);
$context->required('subscriber_relationship')->listOption('sub_relation')
->callback(function ($value, $values) {
if (
Expand Down
2 changes: 1 addition & 1 deletion src/Validators/PatientValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function configureValidator()
$this->validator->context(
self::DATABASE_INSERT_CONTEXT,
function (Validator $context) {
$context->required("fname", "First Name")->lengthBetween(2, 255);
$context->required("fname", "First Name")->lengthBetween(1, 255);
$context->required("lname", 'Last Name')->lengthBetween(2, 255);
$context->required("sex", 'Gender')->lengthBetween(4, 30);
$context->required("DOB", 'Date of Birth')->datetime('Y-m-d');
Expand Down
4 changes: 2 additions & 2 deletions tests/Tests/Services/PatientServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testGetFreshPid()
*/
public function testInsertFailure()
{
$this->patientFixture["fname"] = "A";
$this->patientFixture["fname"] = "";
$this->patientFixture["DOB"] = "12/27/2017";
unset($this->patientFixture["sex"]);

Expand Down Expand Up @@ -93,7 +93,7 @@ public function testUpdateFailure()
{
$this->patientService->insert($this->patientFixture);

$this->patientFixture["fname"] = "A";
$this->patientFixture["fname"] = "";

$actualResult = $this->patientService->update("not-a-uuid", $this->patientFixture);

Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/Validators/PatientValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function testValidationInsertSuccess()
public function testValidationUpdateFailure()
{
$this->patientFixture["uuid"] = $this->fixtureManager->getUnregisteredUuid();
$this->patientFixture["fname"] = "A";
$this->patientFixture["fname"] = "";
$this->patientFixture["sex"] = "M";

$actualResult = $this->patientValidator->validate($this->patientFixture, PatientValidator::DATABASE_UPDATE_CONTEXT);
Expand Down

0 comments on commit 704bfd0

Please sign in to comment.