Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 41s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 41s
Details
This commit is contained in:
commit
c6d800f309
|
|
@ -74,7 +74,7 @@
|
|||
class="form-control"
|
||||
{{$question->required == 'yes'?'required':'' }}
|
||||
value="{{isset($question->value) ? $question->value : ($question->code == 'record_date' ? date('Y-m-d') : '')}}"
|
||||
{{ $question->code == 'record_date' ? 'readonly' : '' }}>
|
||||
{{ in_array($question->code, ['record_date', 'msl_code']) ? 'readonly' : '' }}>
|
||||
@break
|
||||
@case('number')
|
||||
<input type="{{$question->type}}" min="0" max="9999999999" step="1" id="field-{{$question->code}}" name="{{$question->code}}" class="form-control" {{$question->required == 'yes'?'required':'' }} value="{{isset($question->value)?$question->value:0}}">
|
||||
|
|
|
|||
|
|
@ -229,7 +229,20 @@
|
|||
$('#field-contact_id').html('')
|
||||
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
|
||||
for (let itm of data) {
|
||||
$('#field-contact_id').append($("<option></option>").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality).attr("absi_camp", itm.contact.absi_camp || ''));
|
||||
|
||||
let absiCamp = itm.contact.absi_camp;
|
||||
|
||||
console.log("Doctor:", itm.display);
|
||||
console.log("ABSI from API:", absiCamp);
|
||||
|
||||
$('#field-contact_id').append(
|
||||
$("<option></option>")
|
||||
.attr("value", itm.value)
|
||||
.text(itm.display)
|
||||
.attr("msl_code", itm.contact.msl_code || '')
|
||||
.attr("speciality", itm.contact.speciality || '')
|
||||
.attr("absi_camp", absiCamp || '')
|
||||
);
|
||||
}
|
||||
|
||||
$('#field-contact_id').change(function() {
|
||||
|
|
@ -300,9 +313,27 @@
|
|||
|
||||
|
||||
$('#field-contact_id').change(function() {
|
||||
$('#field-absi_camp').val(
|
||||
$('option:selected', this).attr('absi_camp') || ''
|
||||
);
|
||||
|
||||
const selectedDoctor = $('option:selected', this);
|
||||
|
||||
let absiCamp = selectedDoctor.attr('absi_camp') || '';
|
||||
|
||||
console.log("Selected doctor:", selectedDoctor.text());
|
||||
console.log("ABSI attribute:", absiCamp);
|
||||
|
||||
// Convert 1/0 to Yes/No if required
|
||||
if (absiCamp == 1 || absiCamp === '1') {
|
||||
absiCamp = 'Yes';
|
||||
}
|
||||
else if (absiCamp == 0 || absiCamp === '0') {
|
||||
absiCamp = 'No';
|
||||
}
|
||||
|
||||
$('#field-absi_camp').val(absiCamp);
|
||||
|
||||
// This will show/hide No of Patients Screened
|
||||
toggleAbsiPatientsField();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
@ -314,9 +345,71 @@
|
|||
);
|
||||
});
|
||||
|
||||
$('#field-pmos_dr').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="pmos_dr_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
$('#field-qbs_dr').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="qbs_dr_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
$('#field-adboard_dr').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="adboard_dr_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
$('#field-fb_live_dr').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="fb_live_dr_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
$('#field-ecme_dr').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="ecme_dr_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
$('#field-rtm_dr').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="rtm_dr_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
$('#field-absi_camp').on('change', function(){
|
||||
|
||||
let value = $(this).val();
|
||||
|
||||
if(value == 'Yes'){
|
||||
$('#report-form input[name="absi_camp_count"]').val(1);
|
||||
} else {
|
||||
$('#report-form input[name="absi_camp_count"]').val(0);
|
||||
}
|
||||
|
||||
toggleAbsiPatientsField();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$('#field-h1_cardio_conference').on('change',function(){
|
||||
let value=$(this).val();
|
||||
if(value=='Yes'){
|
||||
$('#report-form').append('<input type="hidden" name="h1_cardio_conference_count" value="1">')
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
$('#field-msl_code,#field-speciality').attr('readonly',true);
|
||||
|
||||
|
|
@ -334,19 +427,59 @@
|
|||
].join(',');
|
||||
|
||||
function toggleFields(selector, show) {
|
||||
$(selector).parent().toggle(show);
|
||||
$(selector).prop('required', show);
|
||||
$(selector).parent().toggle(show);
|
||||
$(selector).prop('required', show);
|
||||
}
|
||||
|
||||
function toggleAbsiPatientsField() {
|
||||
|
||||
let absiCamp = $('#field-absi_camp').val();
|
||||
const brand = $('#field-select_brand').val();
|
||||
|
||||
// Convert stored 1/0 values to Yes/No
|
||||
if (absiCamp == 1 || absiCamp === '1') {
|
||||
absiCamp = 'Yes';
|
||||
$('#field-absi_camp').val('Yes');
|
||||
}
|
||||
else if (absiCamp == 0 || absiCamp === '0') {
|
||||
absiCamp = 'No';
|
||||
$('#field-absi_camp').val('No');
|
||||
}
|
||||
|
||||
const $patientsField = $('#field-no_of_patients_screened');
|
||||
const $patientsWrapper = $patientsField.closest('.col-md-12');
|
||||
|
||||
console.log("Brand:", brand);
|
||||
console.log("ABSI:", absiCamp);
|
||||
|
||||
if (brand === 'Glipiq' && absiCamp === 'Yes') {
|
||||
|
||||
$patientsWrapper.show();
|
||||
$patientsField.prop('required', true);
|
||||
|
||||
} else {
|
||||
|
||||
$patientsField.val('');
|
||||
$patientsWrapper.hide();
|
||||
$patientsField.prop('required', false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Initial hide
|
||||
toggleFields(glipiFields, false);
|
||||
toggleFields(sitazitFields, false);
|
||||
|
||||
$('#field-no_of_patients_screened').parent().hide();
|
||||
$('#field-no_of_patients_screened').prop('required', false);
|
||||
|
||||
|
||||
$('#field-select_brand').on('change', function () {
|
||||
const brand = $(this).val();
|
||||
console.log("Brand is :",brand);
|
||||
toggleFields(glipiFields, brand === 'Glipiq');
|
||||
toggleFields(sitazitFields, brand === 'Sitazit');
|
||||
toggleAbsiPatientsField();
|
||||
|
||||
if(brand==='Glipiq'){
|
||||
/* $('#report-form').append('<input type="hidden" name="glipiq_rx_total" value="0" >');
|
||||
|
|
@ -397,6 +530,7 @@
|
|||
|
||||
$('#field-absi_camp').val("");
|
||||
$('#field-h1_cardio_conference').val("");
|
||||
toggleAbsiPatientsField();
|
||||
$('#report-form input[name="glipiq_new_conversion"]').val(0);
|
||||
$('#report-form input[name="glipiq_existing_conversion"]').val(0);
|
||||
$('#report-form input[name="glipiq_rx_total"]').val(0);
|
||||
|
|
|
|||
Loading…
Reference in New Issue