code: def save_message_from_pat_portal(self, patient_id,
                                       p_vendor_name,
                                       p_message_id,
                                       p_practice_id,
                                       message,
                                       sent_date,
                                       transaction_type
                                       ):
          
          portal_info_xml = '<msg>' + \
                            '<ppvendor value="@@VENDOR@@" />' + \
                            '<ppmsgid value="@@MESSAGEID@@" />' + \
                            '<pppractice value="@@PRACTICE@@" />' + \
                            '</msg>'
          portal_info_xml = portal_info_xml.replace(
              '@@VENDOR@@', p_vendor_name).replace(
              '@@MESSAGEID@@', p_message_id).replace(
              '@@PRACTICE@@', p_practice_id)
  
          magic = self._magic_json(
              action=TouchWorksMagicConstants.ACTION_SAVE_MSG_FROM_PAT_PORTAL,
              patient_id=patient_id,
              parameter1=portal_info_xml,
              parameter2=self._ehr_username,
              parameter3=message,
              parameter4=sent_date,
              parameter5=transaction_type)
  
          response = self._http_request(TouchWorksEndPoints.MAGIC_JSON, data=magic)
          result = self._get_results_or_raise_if_magic_invalid(
              magic,
              response,
              TouchWorksMagicConstants.RESULT_SAVE_MSG_FROM_PAT_PORTAL)
          return result
docs: invokes TouchWorksMagicConstants.ACTION_GET_ENCOUNTER_LIST_FOR_PATIENT action
          :param
          :param message
          :param sent_date
          :param transaction_type -   type	To register a patient with the portal,
              this should be 'Register Patient Request.'
                  Valid types are stored in iHealth_TransCode_DE.
                  Approve Online Consultation
                  Custom Form Submitted
                  Decline Online Consultation
                  Deny Patient Registration
                  Form Requested
                  Health Remiders
                  Register Patient
                  Register Patient Request
                  RenewRx
                  Seek Appointment
                  Seek Online Consultation
                  Send Clinical Document
                  Send General Message
                  Send Notification Message
                  Unregister Patient
          :return: JSON response