|
@@ -72,74 +72,80 @@ class FrameBedVosConfinementAdapter(val data: ArrayList<FrameBedVO>) : BaseDeleg
|
|
|
*/
|
|
|
override fun onBindViewHolder(holder: BaseRecyclerViewHolder<AdapterHospitalFramePartBinding>?, position: Int) {
|
|
|
holder?.bind { binding ->
|
|
|
- val itemData = getItem(position)
|
|
|
- if (itemData.customerName != null) {
|
|
|
- binding.patientNameTv.text = itemData.customerName
|
|
|
- } else {
|
|
|
- binding.patientImagev.setImageResource(R.drawable.kong_chuang)
|
|
|
- binding.patientNameTv.setText(R.string.empty_bed)
|
|
|
- }
|
|
|
+ try {
|
|
|
+ val itemData = getItem(position)
|
|
|
+ if (itemData.customerName != null) {
|
|
|
+ binding.patientNameTv.text = itemData.customerName
|
|
|
+ } else {
|
|
|
+ binding.patientImagev.setImageResource(R.drawable.kong_chuang)
|
|
|
+ binding.patientNameTv.setText(R.string.empty_bed)
|
|
|
+ }
|
|
|
|
|
|
- if (itemData.customerAge != null) {
|
|
|
- binding.patientAgeTv.text = itemData.customerAge.toString() + itemData.customerAgeUnit
|
|
|
- } else {
|
|
|
- binding.patientAgeTv.text = "--"
|
|
|
- }
|
|
|
+ if (itemData.customerAge != null) {
|
|
|
+ binding.patientAgeTv.text =
|
|
|
+ itemData.customerAge.toString() + itemData.customerAgeUnit
|
|
|
+ } else {
|
|
|
+ binding.patientAgeTv.text = "--"
|
|
|
+ }
|
|
|
|
|
|
- binding.roomNumberTv.text = itemData.frameBed.fullName
|
|
|
- binding.roomNumberTv.setTextColor(Color.parseColor("#2F9DF1"))
|
|
|
-
|
|
|
- var critical = false
|
|
|
- binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
|
|
|
- if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
|
|
|
- for (nurseConfig in itemData.nurseConfigDtos) {
|
|
|
- if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
|
|
|
- binding.roomNumberTv.setTextColor(Color.WHITE)
|
|
|
- //病危标识
|
|
|
- binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector_critical)
|
|
|
- binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
|
|
|
- if (!TextUtils.isEmpty(nurseConfig.nurseColorRbg)) {
|
|
|
+ binding.roomNumberTv.text = itemData.frameBed.fullName
|
|
|
+ binding.roomNumberTv.setTextColor(Color.parseColor("#2F9DF1"))
|
|
|
+
|
|
|
+ var critical = false
|
|
|
+ binding.rlBedInfo.setBackgroundResource(R.drawable.item_selector)
|
|
|
+ if (itemData.nurseConfigDtos != null && itemData.nurseConfigDtos.size > 0) {
|
|
|
+ for (nurseConfig in itemData.nurseConfigDtos) {
|
|
|
+ if (nurseConfig.boolCritical != null && nurseConfig.boolCritical) {
|
|
|
+ binding.roomNumberTv.setTextColor(Color.WHITE)
|
|
|
+ //病危标识
|
|
|
+ binding.tvNurseConfigName.text = nurseConfig.nurseConfigName
|
|
|
+ if (!TextUtils.isEmpty(nurseConfig.nurseColorRbg)) {
|
|
|
+ binding.rlBedInfo.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
|
|
|
+ binding.tvNurseConfigColor.visibility = View.VISIBLE
|
|
|
+ binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
|
|
|
+ binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
|
|
|
+ } else {
|
|
|
+ binding.rlBedInfo.setBackgroundResource(R.color.color_critical)
|
|
|
+ binding.tvNurseConfigColor.text = ""
|
|
|
+ binding.tvNurseConfigColor.visibility = View.INVISIBLE
|
|
|
+ }
|
|
|
+ critical = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!critical) {
|
|
|
+ val nurseItem = itemData.nurseConfigDtos.get(0)
|
|
|
+ binding.tvNurseConfigName.text = nurseItem.nurseConfigName
|
|
|
+ if (!TextUtils.isEmpty(nurseItem.nurseColorRbg)) {
|
|
|
+ binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
|
|
|
binding.tvNurseConfigColor.visibility = View.VISIBLE
|
|
|
- binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseConfig.nurseColorRbg))
|
|
|
- binding.tvNurseConfigColor.text = nurseConfig.nurseOptionName
|
|
|
+ binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
|
|
|
} else {
|
|
|
binding.tvNurseConfigColor.text = ""
|
|
|
binding.tvNurseConfigColor.visibility = View.INVISIBLE
|
|
|
}
|
|
|
- critical = true
|
|
|
- break
|
|
|
}
|
|
|
+ } else {
|
|
|
+ binding.tvNurseConfigName.text = ""
|
|
|
+ binding.tvNurseConfigColor.text = ""
|
|
|
+ binding.tvNurseConfigColor.visibility = View.INVISIBLE
|
|
|
}
|
|
|
|
|
|
- if (!critical) {
|
|
|
- val nurseItem = itemData.nurseConfigDtos.get(0)
|
|
|
- binding.tvNurseConfigName.text = nurseItem.nurseConfigName
|
|
|
- if (!TextUtils.isEmpty(nurseItem.nurseColorRbg)) {
|
|
|
- binding.tvNurseConfigColor.text = nurseItem.nurseOptionName
|
|
|
- binding.tvNurseConfigColor.visibility = View.VISIBLE
|
|
|
- binding.tvNurseConfigColor.setBackgroundColor(Color.parseColor("#" + nurseItem.nurseColorRbg))
|
|
|
+ if (itemData.customerSex != null) {
|
|
|
+ binding.sexImagev.visibility = View.VISIBLE
|
|
|
+ if (itemData.customerSex == 1) {
|
|
|
+ binding.sexImagev.setImageResource(R.drawable.man)
|
|
|
+ binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing_man)
|
|
|
} else {
|
|
|
- binding.tvNurseConfigColor.text = ""
|
|
|
- binding.tvNurseConfigColor.visibility = View.INVISIBLE
|
|
|
+ binding.sexImagev.setImageResource(R.drawable.nv)
|
|
|
+ binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing)
|
|
|
}
|
|
|
- }
|
|
|
- } else {
|
|
|
- binding.tvNurseConfigName.text = ""
|
|
|
- binding.tvNurseConfigColor.text = ""
|
|
|
- binding.tvNurseConfigColor.visibility = View.INVISIBLE
|
|
|
- }
|
|
|
-
|
|
|
- if (itemData.customerSex != null) {
|
|
|
- binding.sexImagev.visibility = View.VISIBLE
|
|
|
- if (itemData.customerSex == 1) {
|
|
|
- binding.sexImagev.setImageResource(R.drawable.man)
|
|
|
- binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing_man)
|
|
|
} else {
|
|
|
- binding.sexImagev.setImageResource(R.drawable.nv)
|
|
|
- binding.patientImagev.setImageResource(R.drawable.bing_ren_xiang_qing)
|
|
|
+ binding.sexImagev.visibility = View.GONE
|
|
|
}
|
|
|
- } else {
|
|
|
- binding.sexImagev.visibility = View.GONE
|
|
|
+ } catch (ex: Exception) {
|
|
|
+ ex.printStackTrace()
|
|
|
}
|
|
|
|
|
|
//Log.e("FrameBedVosAdapter ", "FrameBedVosAdapter...." + itemData.customerName)
|