diff --git a/resources/views/form/rapport-arise/1777029250-544db702-e048-4499-9b87-95f9ae2d94d5.blade.php b/resources/views/form/rapport-arise/1777029250-544db702-e048-4499-9b87-95f9ae2d94d5.blade.php index 1d2bf11d..1e5b9c8d 100644 --- a/resources/views/form/rapport-arise/1777029250-544db702-e048-4499-9b87-95f9ae2d94d5.blade.php +++ b/resources/views/form/rapport-arise/1777029250-544db702-e048-4499-9b87-95f9ae2d94d5.blade.php @@ -5,6 +5,7 @@ @include('layouts.shared/title-meta', ['title' => 'Form']) @include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? '']) +
processing... @@ -94,9 +95,13 @@ @endphp + @if(isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes') + Executed + @else + @endif {{ $sub->formdata->plan_date }} {{ isset($sub->formdata->execution_done) && $sub->formdata->execution_done == 'yes' ? 'Yes' : 'No' }} @@ -207,7 +212,8 @@ @break @case('dropdown') - code + == 'contact_id')?'data-toggle="select2"':'' !!} id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}> @foreach ($question->options as $option) @if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type != 'Chemist' ) @@ -394,8 +400,10 @@ @include('layouts.shared/footer-script') + + + + + + + + \ No newline at end of file diff --git a/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php b/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php index e18a0ad8..2fe7f955 100644 --- a/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php +++ b/resources/views/form/rapport-team4/1781090899-2cedf382-9fbb-45ac-896b-94de9104a11b.blade.php @@ -105,6 +105,13 @@ $otherMolecule = trim((string) $otherMolecule); } + $otherMoleculeRxSupport = $formdata->other_molecule_rx_support ?? ''; + if (is_array($otherMoleculeRxSupport) || $otherMoleculeRxSupport instanceof \Traversable) { + $otherMoleculeRxSupport = trim((string)(array_values((array)$otherMoleculeRxSupport)[0] ?? '')); + } else { + $otherMoleculeRxSupport = trim((string)$otherMoleculeRxSupport); + } + $recordDate = $formdata->record_date ?? ''; if (is_array($recordDate) || $recordDate instanceof \Traversable) { $recordDate = trim((string) (array_values((array) $recordDate)[0] ?? '')); @@ -123,6 +130,7 @@ 'doctor_name' => $doctorNameById[$doctorId] ?? $rawDoctorId, 'rx_support' => $rxSupport, 'other_molecule_use' => $otherMolecule, + 'other_molecule_rx_support' => $otherMoleculeRxSupport ?? '', 'record_date' => $recordDate, ]; @@ -193,6 +201,7 @@ 'rx_support', 'other_molecule_use', 'molecule_use', + 'other_molecule_rx_support', ]; @endphp @@ -339,17 +348,25 @@
-
{{ ucwords($categoryLabel) }}
+ {{--
{{ ucwords($categoryLabel) }}
--}} +
+ {{ $categoryLabel == 'nac + acebrophylline' + ? 'NAC + Acebrophylline' + : ucwords($categoryLabel) }} +
- - - - + + + + + + + @php $globalRowIndex++; @endphp @endfor @@ -464,6 +492,17 @@ select option:disabled { var categoryDoctorSubmissions = {!! json_encode($categoryDoctorSubmissions) !!}; jQuery(document).ready(function($){ + $(document).on( + 'change', + '.other-molecule-select', + function(){ + + toggleOtherMoleculeRxSupport( + $(this).closest('tr') + ); + + } + ); function getDoctorRows() { let rows = []; @@ -529,6 +568,9 @@ select option:disabled { .val(submission.rx_support || ''); $row.find('.other-molecule-select') .val(submission.other_molecule_use || ''); + $row.find('.other-molecule-rx-support') + .val(submission.other_molecule_rx_support || ''); + toggleOtherMoleculeRxSupport($row); setSubmissionId($row, submission.submission_id); }); } @@ -538,8 +580,44 @@ select option:disabled { prefillDoctorTableSection($(this), $(this).data('category')); }); } + function checkOtherRxHeader(){ - function updateDoctorDropdowns($tbody) { + let visible = false; + + $('.other-molecule-rx-cell').each(function(){ + + if($(this).is(':visible')){ + visible = true; + } + + }); + + if(visible){ + $('.other-rx-header').show(); + }else{ + $('.other-rx-header').hide(); + } + + } + function toggleOtherMoleculeRxSupport($row){ + + let value = $row.find('.other-molecule-select').val(); + + if( + value && + value !== 'No' + ){ + $row.find('.other-molecule-rx-cell').show(); + $('.other-rx-header').show(); + }else{ + $row.find('.other-molecule-rx-cell').hide(); + $row.find('.other-molecule-rx-support').val(''); + } + + checkOtherRxHeader(); + } + + /* function updateDoctorDropdowns($tbody) { let selectedDoctors = []; $tbody.find('.doctor-select').each(function() { @@ -574,7 +652,47 @@ select option:disabled { }); }); } + */ + function updateDoctorDropdowns() { + let selectedDoctors = []; + + $('.doctor-select').each(function() { + let value = $(this).val(); + + if (value) { + selectedDoctors.push(value); + } + }); + + $('.doctor-select').each(function() { + + let currentDropdown = $(this); + let currentValue = currentDropdown.val(); + + currentDropdown.find('option').each(function() { + + let option = $(this); + let originalText = option.data('original-text') || option.text(); + + option.data('original-text', originalText); + option.text(originalText); + option.prop('disabled', false); + + let optionValue = option.val(); + + if ( + optionValue && + optionValue !== currentValue && + selectedDoctors.includes(optionValue) + ) { + option.prop('disabled', true); + option.text(originalText + ' (Already Added)'); + } + }); + + }); + } function updateOtherMoleculeDropdowns($tbody) { let sectionMolecule = $tbody.data('molecule-use'); @@ -600,7 +718,7 @@ select option:disabled { function buildSubmitFormData() { let fd = new FormData(); let form = $('#report-form')[0]; - let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select']; + let rowFieldClasses = ['doctor-select', 'rx-support-select', 'other-molecule-select', 'other-molecule-rx-support']; Array.from(form.elements).forEach(function(el) { if (!el.name || el.disabled) { @@ -652,6 +770,7 @@ select option:disabled { fd.append('contact_id[]', $row.find('.doctor-select').val()); fd.append('rx_support[]', $row.find('.rx-support-select').val()); fd.append('other_molecule_use[]', $row.find('.other-molecule-select').val()); + fd.append('other_molecule_rx_support[]', $row.find('.other-molecule-rx-support').val()); fd.append('molecule_use[]', item.moleculeUse); let submissionId = $row.attr('data-submission-id'); @@ -663,8 +782,11 @@ select option:disabled { return fd; } - $(document).on('change', '.doctor-select', function() { + /*$(document).on('change', '.doctor-select', function() { updateDoctorDropdowns($(this).closest('.doctor-table-body')); + });*/ + $(document).on('change', '.doctor-select', function() { + updateDoctorDropdowns(); }); $('.doctor-select').select2({ @@ -675,12 +797,18 @@ select option:disabled { prefillAllDoctorTables(); - $('.doctor-table-body').each(function() { + /* $('.doctor-table-body').each(function() { let $tbody = $(this); updateOtherMoleculeDropdowns($tbody); updateDoctorDropdowns($tbody); + }); */ + $('.doctor-table-body').each(function() { + let $tbody = $(this); + updateOtherMoleculeDropdowns($tbody); }); + updateDoctorDropdowns(); + $('#report-form').on('submit', function(event) { event.preventDefault(); @@ -692,6 +820,7 @@ select option:disabled { processData: false, contentType: false, success: function(data) { + $("#pageloader").fadeOut(); if (data.status == 'success') { Swal.fire({ diff --git a/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php b/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php index 584b0e82..8fe1e5f2 100644 --- a/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php +++ b/resources/views/form/rapport-titans/1781584857-4d01f5cd-e316-4299-a2a7-31d257766b0a.blade.php @@ -90,7 +90,24 @@ @endif @endforeach - + + @elseif ($question->code == 'name_of_other_hcp') + @foreach ($question->options as $option) + @if(!isset($option->contact->ciphaler_rxber) || trim($option->contact->ciphaler_rxber) == '') + + @endif + @endforeach + + + @else @foreach ($question->options as $option)
Doctor NameRxn/Week SupportOther Molecule Use
Doctor NameRxn/Week SupportOther Molecule Use
+