@@ -463,7 +463,9 @@ export function compareValue(firstAnswerValue: AnswerValue, secondAnswerValue: A
463463 const secondValueType = getAnswerValueType ( secondAnswerValue ) ;
464464
465465 if ( firstValueType !== secondValueType ) {
466- throw new Error ( 'Enable when must be used for the same type' ) ;
466+ throw new Error (
467+ `Enable when must be used for the same type, first type is ${ firstValueType } , second type is ${ secondValueType } ` ,
468+ ) ;
467469 }
468470 if ( ! _ . includes ( FHIRPrimitiveTypes , firstValueType ) ) {
469471 throw new Error ( 'Impossible to compare non-primitive type' ) ;
@@ -488,7 +490,9 @@ export function isValueEqual(firstValue: AnswerValue, secondValue: AnswerValue)
488490 const secondValueType = getAnswerValueType ( secondValue ) ;
489491
490492 if ( firstValueType !== secondValueType ) {
491- console . error ( 'Enable when must be used for the same type' ) ;
493+ console . error (
494+ `Enable when must be used for the same type, first type is ${ firstValueType } , second type is ${ secondValueType } ` ,
495+ ) ;
492496
493497 return false ;
494498 }
@@ -863,7 +867,7 @@ export function getAnswerValues(answers: FormAnswerItems[]) {
863867 return _ . reject ( answers , ( { value } ) => isAnswerValueEmpty ( value ) ) . map ( ( { value } ) => value ! ) ;
864868}
865869
866- export function isAnswerValueEmpty ( value : { [ x : string ] : any } | undefined | null ) {
870+ export function isAnswerValueEmpty ( value : AnswerValue | undefined | null ) {
867871 return isValueEmpty ( value ) || _ . every ( _ . mapValues ( value , isValueEmpty ) ) ;
868872}
869873
0 commit comments