ajustes do post e campos para o envio para a api
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:rkm/widgets/alert_dialog_default.dart';
|
||||
import 'package:rkm/widgets/appbar_default.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import '../../config/const_variable.dart';
|
||||
import '../../models/check_proced_sia_model.dart';
|
||||
import '../../models/drop_down_data_string_model.dart';
|
||||
import '../../service/api/api_data_import_sigtap.dart';
|
||||
import '../../service/db/db_querys.dart';
|
||||
@@ -63,6 +64,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
String CID_COD='';
|
||||
|
||||
String? CBO_PROFISSIONAL;
|
||||
String? CBO_PROFISSIONAL_DB;
|
||||
String? CIAP;
|
||||
String? CID;
|
||||
String? CBO_RESP_CADASTRO;
|
||||
@@ -74,7 +76,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
String? CONDUTA;
|
||||
|
||||
List<CheckModel> serviceHomeModel = [];
|
||||
List<CheckModel> serviceProcModel = [];
|
||||
List<CheckProcedSiaModel> serviceProcModel = [];
|
||||
List <String>listCBO = [];
|
||||
List <String>listServicePlace = [];
|
||||
List <String>typeService = [];
|
||||
@@ -87,6 +89,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
List<String> ATENDS_DOM_PROC = [];
|
||||
List<String> listConduct = [];
|
||||
List listProc = [];
|
||||
List CBOS_PROFISSIONAL=[];
|
||||
|
||||
bool CNS_VALIDO = false;
|
||||
bool mandatory = false;
|
||||
@@ -243,7 +246,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
// adicionar depois e usar um usuário real
|
||||
// CBO_RESP_CADASTRO
|
||||
//ok
|
||||
if(date.isEmpty || dateDB.isEmpty || LOCAL_ATENDIMENTO_COD==0 || TIPO_ATENDIMENTO_COD ==0 || MODALIDADE_COD == 0 || TURNO_COD == 0 || CBO_PROFISSIONAL == null
|
||||
if(date.isEmpty || dateDB.isEmpty || LOCAL_ATENDIMENTO_COD==0 || TIPO_ATENDIMENTO_COD ==0 || MODALIDADE_COD == 0 || TURNO_COD == 0 || CBO_PROFISSIONAL == null || CONDUTA == null
|
||||
){
|
||||
print('erro');
|
||||
setState(() {
|
||||
@@ -265,7 +268,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
'ID_CIDADAO' : ID_CIDADAO,
|
||||
'CD_USUARIO_SUS' : CD_USUARIO_SUS,
|
||||
'ID_PROFISSIONAL' : idUsuario,
|
||||
'CBO_PROFISSIONAL' : CBO_PROFISSIONAL,
|
||||
'CBO_PROFISSIONAL' : CBO_PROFISSIONAL_DB,
|
||||
'INE_PROFISSIONAL' : INE_PROFISSIONAL,
|
||||
'CNES_UNIDADE' : CNES_UNIDADE.text,
|
||||
'ID_UNIDADE' : int.parse(idUnidade),
|
||||
@@ -288,7 +291,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
}
|
||||
for(int i = 0;serviceProcModel.length>i;i++){
|
||||
if(serviceProcModel[i].check){
|
||||
DbSqliteSync().insertProcedimentosDomiciliares(value,i+1);
|
||||
DbSqliteSync().insertProcedimentosDomiciliares(value,serviceProcModel[i].COD_SIA);
|
||||
}
|
||||
}
|
||||
AlertDialogDefault().alert(
|
||||
@@ -375,7 +378,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
onChanged: (v)=>setState((){}),
|
||||
),
|
||||
DropdownWithSubtitle(
|
||||
list: PROCEDIMENTOS_SIGTAP,
|
||||
list: listCBO,
|
||||
widthSubtitle: width*0.7,
|
||||
subtitle: 'CBO',
|
||||
hintDropdown: 'CBO',
|
||||
@@ -385,6 +388,9 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
onChanged: (value){
|
||||
setState(() {
|
||||
CBO_PROFISSIONAL = value!;
|
||||
List list = CBO_PROFISSIONAL.toString().split(' - ');
|
||||
CBO_PROFISSIONAL_DB = list.last;
|
||||
print(CBO_PROFISSIONAL_DB);
|
||||
});
|
||||
},
|
||||
colorBorder: ColorPalette.white,
|
||||
@@ -651,20 +657,25 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
itemCount: ConstVariable().serviceHomeCheckProclist.length,
|
||||
itemBuilder: (context,index){
|
||||
|
||||
List aux = ConstVariable().serviceHomeCheckProclist;
|
||||
aux.sort();
|
||||
|
||||
serviceProcModel.add(
|
||||
CheckModel(
|
||||
subtitle: aux[index],
|
||||
check: false
|
||||
CheckProcedSiaModel(
|
||||
COD_SIA: ConstVariable().serviceHomeCheckProclist[index].COD_SIA,
|
||||
DESCRICAO_PROCEDIMENTO: ConstVariable().serviceHomeCheckProclist[index].DESCRICAO_PROCEDIMENTO,
|
||||
)
|
||||
);
|
||||
|
||||
// print(serviceProcModel[index].subtitle);
|
||||
|
||||
return CheckBoxSubtitle(
|
||||
subtitle: serviceProcModel[index].subtitle,
|
||||
subtitle: serviceProcModel[index].DESCRICAO_PROCEDIMENTO,
|
||||
checkbox:serviceProcModel[index].check,
|
||||
width: width*0.6,
|
||||
onChanged: (value)=>setState(()=>serviceProcModel[index].check=value),
|
||||
onChanged: (value)=>setState((){
|
||||
serviceProcModel[index].check=value;
|
||||
print(serviceProcModel[index].COD_SIA);
|
||||
print(serviceProcModel[index].DESCRICAO_PROCEDIMENTO);
|
||||
print(serviceProcModel[index].check);
|
||||
}),
|
||||
);
|
||||
}
|
||||
),
|
||||
@@ -699,7 +710,7 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
IconButton(
|
||||
icon: Icon(Icons.add_circle,color: ColorPalette.blackButton),
|
||||
onPressed: (){
|
||||
AlertDialogDefault().otherProc(context, 'Outros Procedimentos', 'Adicionar Procedimento', CBO_PROFISSIONAL, CBO_PROFISSIONAL, 'add',listCBO,listProc);
|
||||
AlertDialogDefault().otherProc(context, 'Outros Procedimentos', 'Adicionar Procedimento', CBO_PROFISSIONAL, CBO_PROFISSIONAL, 'add',PROCEDIMENTOS_SIGTAP,listProc);
|
||||
},
|
||||
)
|
||||
],
|
||||
@@ -726,37 +737,42 @@ class _AtendimentoDomiciliarTelaState extends State<AtendimentoDomiciliarTela> {
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5.0),
|
||||
child: Container(
|
||||
width: width*0.7,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: 'Conduta / Desfecho',fontSize: 15),
|
||||
Spacer(),
|
||||
DropdownWithSubtitle(
|
||||
colorBorder: ColorPalette.white,
|
||||
list: listConduct,
|
||||
subtitle: 'SELECIONE',
|
||||
select: CONDUTA,
|
||||
widthDropdown: width*0.39,
|
||||
widthContainerDropdown: width*0.3,
|
||||
widthSubtitle: width*0.3,
|
||||
hintDropdown: 'SELECIONE',
|
||||
onChanged: (value){
|
||||
CONDUTA = value;
|
||||
for(int i = 0;ConstVariable().listConduct.length >i;i++){
|
||||
if(ConstVariable().listConduct[i].title == CONDUTA){
|
||||
CONDUTA_COD = ConstVariable().listConduct[i].cod;
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: width*0.7,
|
||||
child: Row(
|
||||
children: [
|
||||
TextDefault(text: 'Conduta / Desfecho',fontSize: 15),
|
||||
Spacer(),
|
||||
DropdownWithSubtitle(
|
||||
colorBorder: ColorPalette.white,
|
||||
list: listConduct,
|
||||
subtitle: 'SELECIONE',
|
||||
select: CONDUTA,
|
||||
widthDropdown: width*0.39,
|
||||
widthContainerDropdown: width*0.3,
|
||||
widthSubtitle: width*0.3,
|
||||
hintDropdown: 'SELECIONE',
|
||||
onChanged: (value){
|
||||
CONDUTA = value;
|
||||
for(int i = 0;ConstVariable().listConduct.length >i;i++){
|
||||
if(ConstVariable().listConduct[i].title == CONDUTA){
|
||||
CONDUTA_COD = ConstVariable().listConduct[i].cod;
|
||||
}
|
||||
}
|
||||
setState(() {});
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
CONDUTA_COD ==0 && mandatory?ErrorDefault():Container(),
|
||||
],
|
||||
)
|
||||
)
|
||||
),
|
||||
]
|
||||
)
|
||||
),
|
||||
]
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user